I'm using $cordovaPush (from ngCordova features) that use PushPlugin for making push notification feature for iOS and Android, I need to implement this feature on iOS using PHP as server-side, currently I choose pushbots.com and it's good, but how can I link local server (that I put php file for pushing a message) with PushPlugin configuration?
this is a basic code in app.js:
angular.module('starter', ['ionic', 'ngCordova', 'starter.controllers', 'starter.services'])
.config(function($compileProvider){
$compileProvider.imgSrcSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|tel|blob):|data:image\//);
})
.run(function($ionicPlatform, $cordovaPush, $http) {
$ionicPlatform.ready(function() {
..
if (window.PushNotification) {
var iOSconfig = { // iOS configuration only
"badge":"true",
"sound":"true",
"alert":"true"
}
$cordovaPush.register(iOSconfig).then(function(result) {
alert(result);
}, function(err) {
alert(err);
});
}
});
})
When I run the app, this message is appear to me:
- no valid 'aps-environment' etitlement string found for application
From this message, I understand that I have to set apn server to send notification messages + create certification for enable Push Notification (I already did that and put it on pushbots.com), but I don't have idea how to set that or link it with PushPlugin configuration, I search on this forum and other websites, but I didn't find what I need.
Check if your app have Push Notifications enabled. (Apple Developer -> Member Center -> Certificates, Identifiers & Profiles -> Identifiers -> App IDs)
Update your Provisioning Profile, if your app wasn't set to receive Push Notifications
The Provisioning Profile must not be a wildcard profile.
Hope it helps