Hi,
I’m trying to get basic application working with push notifications on IOS. I have created really simple and basic application using the following code
10143 ionic start aaa tabs
10145 cd aaa
10146 pod setup
10147 cordova plugin add cordova-plugin-crosswalk-webview
10148 ionic cordova plugin add phonegap-plugin-push --variable SENDER_ID=XXXXXXXXX
10149 npm install --save @ionic-native/push
10150 ionic Cordova platform add ios
10151 cordova platform add ios
10152 code .
10153 ionic cordova build ios --prod --verbose
Build runs without any problems and I’m able to open workspace in Xcode - enable push notifications and build and run application.
However as soon as I’m going to do that application hangs and not much happens in the log debug output that I could tell from
2017-06-15 15:26:17.501088+0200 MyApp[2573:1048327] Apache Cordova native platform version 4.3.1 is starting.
2017-06-15 15:26:17.501626+0200 MyApp[2573:1048327] Multi-tasking -> Device: YES, App: YES
2017-06-15 15:26:17.618780+0200 MyApp[2573:1048327] Using UIWebView
2017-06-15 15:26:17.619991+0200 MyApp[2573:1048327] [CDVTimer][handleopenurl] 0.061989ms
2017-06-15 15:26:17.621536+0200 MyApp[2573:1048327] [CDVTimer][intentandnavigationfilter] 1.497984ms
2017-06-15 15:26:17.621612+0200 MyApp[2573:1048327] [CDVTimer][gesturehandler] 0.043988ms
2017-06-15 15:26:17.622350+0200 MyApp[2573:1048327] [CDVTimer][keyboard] 0.672996ms
2017-06-15 15:26:17.661863+0200 MyApp[2573:1048327] [CDVTimer][statusbar] 39.430022ms
2017-06-15 15:26:17.680143+0200 MyApp[2573:1048327] [CDVTimer][splashscreen] 18.200040ms
2017-06-15 15:26:17.680194+0200 MyApp[2573:1048327] [CDVTimer][TotalPluginStartup] 60.283005ms
2017-06-15 15:26:17.686247+0200 MyApp[2573:1048327] createNotificationChecker
2017-06-15 15:26:17.686288+0200 MyApp[2573:1048327] not coldstart
2017-06-15 15:26:17.687556+0200 MyApp[2573:1048327] active
2017-06-15 15:26:17.687718+0200 MyApp[2573:1048327] PushPlugin skip clear badge
2017-06-15 15:26:17.734426+0200 MyApp[2573:1048362] libMobileGestalt MobileGestaltSupport.m:153: pid 2573 (MyApp) does not have sandbox access for frZQaeyWLUvLjeuEK43hmg and IS NOT appropriately entitled
2017-06-15 15:26:17.734485+0200 MyApp[2573:1048362] libMobileGestalt MobileGestalt.c:550: no access to InverseDeviceID (see <rdar://problem/11744455>)
2017-06-15 15:26:19.607743+0200 MyApp[2573:1048327] Resetting plugins due to page load.
2017-06-15 15:26:19.840462+0200 MyApp[2573:1048327] Finished load of: file:///var/containers/Bundle/Application/823CCE79-12A1-4E35-94E0-CAEC3F7B4DDB/MyApp.app/www/index.html
2017-06-15 15:26:19.868450+0200 MyApp[2573:1048327] Ionic Native: deviceready event fired after 73 ms
Info on ionic
global packages:
@ionic/cli-utils : 1.4.0
Cordova CLI : 6.5.0
Ionic CLI : 3.4.0
local packages:
@ionic/app-scripts : 1.3.7
@ionic/cli-plugin-cordova : 1.4.0
@ionic/cli-plugin-ionic-angular : 1.3.1
Cordova Platforms : ios 4.3.1
Ionic Framework : ionic-angular 3.3.0
System:
Node : v6.9.5
OS : macOS Sierra
Xcode : Xcode 8.3.3 Build version 8E3004b
ios-deploy : 1.9.1
ios-sim : 5.0.13
npm : 4.1.2
My code in app components is following
import { Component } from '@angular/core';
import { Platform } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import { HomePage } from '../pages/home/home';
import { Push, PushObject, PushOptions } from '@ionic-native/push';
@Component({
templateUrl: 'app.html'
})
export class MyApp {
rootPage:any = HomePage;
constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen,private push: Push) {
platform.ready().then(() => {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
// Push Start
// to initialize push notifications
const options: PushOptions = {
android: {
senderID: '-----'
},
ios: {
alert: 'true',
badge: true,
sound: 'false'
},
windows: {}
};
const pushObject: PushObject = this.push.init(options);
pushObject.on('notification').subscribe((notification: any) => console.log('Received a notification', notification));
pushObject.on('registration').subscribe((registration: any) => console.log('Device registered', registration));
pushObject.on('error').subscribe(error => console.error('Error with Push plugin', error));
// Push end
statusBar.styleDefault();
splashScreen.hide();
});
}
}
Is anyone able to point me out what I’m doing here wrong or what I have could be missing ?