Jaime
Jaime

Reputation: 328

cordova-plugin-firebase working in android but not in ios

I'm developing a phonegap mobile app for ios and android and building it with phonegap cli. I have installed cordova-plugin-firebase for push notifications.

Following instructions in https://www.npmjs.com/package/cordova-plugin-firebase

In Android: I have downloaded google-services.json and placed it in platforms/android folder. I'm testing the app in a device and push notifications are working.

In iOS: I have downloaded GoogleService-Info.plist and placed it in platforms/ios/[My Project]/Resources folder. I'm testing the app in a device but push notifications are not working.

Any help? Thanks

EDITED

In my app.js now I have included window.FirebasePlugin.grantPermission() but still is not working:

var app = new Framework7({
root: '#app', // App root element
...
on: {
    init: function () {
        if (Framework7.device.ios) {
            window.FirebasePlugin.grantPermission();
        }
    },
},
...
});

Is that incorrect?

Upvotes: 3

Views: 3482

Answers (1)

Jaime
Jaime

Reputation: 328

Ok, now it's working!

First, I had commentted in index.html this line:

<script src="cordova.js"></script>

Now, uncommentted, the next event handler works (before it wasn't working)

$$(document).on('deviceready', function () {
if (app.device.ios) {         
    window.FirebasePlugin.grantPermission();
}
});

Now the app ask me for grant permission and if I accept push notifications works.

Thanks

Upvotes: 1

Related Questions