appcenter-push
Advanced tools
Comparing version 1.4.0 to 1.5.0
{ | ||
"name": "appcenter-push", | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"description": "React Native plugin for AppCenter Push", | ||
@@ -22,3 +22,3 @@ "main": "Push.js", | ||
"dependencies": { | ||
"appcenter": "1.4.0" | ||
"appcenter": "1.5.0" | ||
}, | ||
@@ -25,0 +25,0 @@ "rnpm": { |
14
Push.js
@@ -9,4 +9,4 @@ const ReactNative = require('react-native'); | ||
const Push = { | ||
const Push = { | ||
// async - returns a Promise | ||
@@ -26,4 +26,12 @@ setEnabled(enabled) { | ||
if (listenerMap && listenerMap.onPushNotificationReceived) { | ||
pushEventEmitter.addListener(pushNotificationReceivedEvent, listenerMap.onPushNotificationReceived); | ||
pushEventEmitter.addListener(pushNotificationReceivedEvent, (pushNotification) => { | ||
// On Android it's null but on iOS nil maps to undefined, make it consistent. | ||
if (pushNotification.title === undefined) { | ||
pushNotification.title = null; | ||
} | ||
if (pushNotification.message === undefined) { | ||
pushNotification.message = null; | ||
} | ||
listenerMap.onPushNotificationReceived(pushNotification); | ||
}); | ||
return AppCenterReactNativePush.sendAndClearInitialNotification(); | ||
@@ -30,0 +38,0 @@ } |
const rnpmlink = require('appcenter-link-scripts'); | ||
console.log('Please enter your Android and iOS app secrets below.'); | ||
console.log('For more information: https://docs.microsoft.com/en-us/appcenter/sdk/getting-started/react-native'); | ||
// Configure Android first. | ||
@@ -33,4 +36,4 @@ let promise = null; | ||
[ | ||
{ pod: 'AppCenter/Push', version: '1.5.0' }, | ||
{ pod: 'AppCenterReactNativeShared', version: '1.4.0' } // in case people don't link appcenter (core) | ||
{ pod: 'AppCenter/Push', version: '1.6.0' }, | ||
{ pod: 'AppCenterReactNativeShared', version: '1.5.0' } // in case people don't link appcenter (core) | ||
], | ||
@@ -37,0 +40,0 @@ { platform: 'ios', version: '9.0' } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
35840
273
+ Addedappcenter@1.5.0(transitive)
+ Addedappcenter-link-scripts@1.5.0(transitive)
- Removedappcenter@1.4.0(transitive)
- Removedappcenter-link-scripts@1.4.0(transitive)
Updatedappcenter@1.5.0