Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <platform name="ios">
- <resource-file src="GoogleService-Info.plist" />
- </platform>
- <plugin name="phonegap-plugin-push" spec="^2.2.3">
- <variable name="SENDER_ID" value="931157632289" />
- </plugin>
- platform.ready().then(() => {
- statusBar.styleDefault();
- splashScreen.hide();
- alert('TESTE1');
- this.push.hasPermission()
- .then((res: any) => {
- if (res.isEnabled) {
- alert('We have permission to send push notifications');
- } else {
- alert('We do not have permission to send push notifications');
- const options: PushOptions = {
- android: {},
- ios: {
- alert: 'true',
- badge: true,
- sound: 'false'
- },
- windows: {},
- browser: {
- pushServiceURL: 'http://push.api.phonegap.com/v1/push'
- }
- };
- const pushObject: PushObject = this.push.init(options);
- pushObject.on('notification').subscribe((notification: any) => {
- alert(notification.message);
- });
- pushObject.on('registration').subscribe((registration: any) =>{
- alert( registration);
- });
- pushObject.on('error').subscribe(error =>{
- alert(error);
- });
- }
- });
- });
Add Comment
Please, Sign In to add comment