I'm doing an Ionic project with Notifications functionality and it works for Android but with iOS, I am having a lot of problems. I read and did all the steps in the Ionic guide to implementing Push Notifications: https://docs.ionic.io/services/push/
In summary: I create Cloud Notification Client for my app, and I added ionic cloud like this:
npm install@ionic/cloud --save
and add the files to my index.html I define the Promise installing:
npm install bluebird --save
And I configurated my app:
angular.module('starter', ['ionic', 'ionic.cloud', 'starter.controllers', 'starter.services'])
.config(function($ionicCloudProvider) {
$ionicCloudProvider.init({
"core": {
"app_id": "APP_ID"
}
});
})
Then to configure the Notifications to iOS I did the same that this guide: https://docs.ionic.io/services/profiles/#android-gcm-project--api-key
Finally I did the set up in my app, and build and run in a real device, android and iOS. The problem is that in Android it works perfectly, but in iOS I save the token perfectly but nothing arrive when I send the notification from Ionic Cloud Dashboard.
Any help?
Thanks a million!
I may be very late in answering your question.Answer is as follows..
At first Install following Plugin under your project
cordova plugin add https://github.com/phonegap/phonegap-plugin-push
You will also need a .pem file and passphrase, you can follow this link for generating them: Generate .pem file Used to setup Apple PUSH Notification
Download following code from here: https://drive.google.com/open?id=0B_-b-DfCLwKdREkwZFdYVEhYWXM
Then merge code in your app.js and after that run your application in iphone and check in console device if you are getting token or not, if device token is showing then move on to next step.
Then you can store device token in database when user login or register.
Then enter your [.pem] file location and pass phrase in [db.class.php]
Then enter device token in [sendIphonenotification.php] file
Then execute [sendIphonenotification.php] file and check your iphone you will get a notification.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.