blueshift-react-native
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -8,3 +8,3 @@ import React, {Component} from 'react'; | ||
componentDidMount() { | ||
componentDidMount() { | ||
// Get the email deep link when app launched from killed state | ||
@@ -35,2 +35,4 @@ Linking.getInitialURL().then(url => { | ||
Blueshift.init(); | ||
// Add custom event listener using Blueshift method | ||
@@ -496,1 +498,46 @@ Blueshift.addEventListener('PushNotificationClickedEvent', this.handlePushClick); | ||
}); | ||
// import React, { useEffect } from 'react'; | ||
// const Root = () => { | ||
// Blueshift.identifyWithDetails({}); | ||
// useEffect(() => { | ||
// console.log('useEffect: START'); | ||
// // Add event listner for `url` event | ||
// global.urlListener = Linking.addEventListener('url', (event) => { | ||
// var url = event.url; | ||
// if(url) { | ||
// // Check if the URL is a rewritten/shortened URL from Blueshift | ||
// if (Blueshift.isBlueshiftUrl(url)) { | ||
// Blueshift.processBlueshiftUrl(url); | ||
// } else { | ||
// console.log('handleDeeplink: ' + url); | ||
// // this.handleDeeplinkUrl(url); | ||
// } | ||
// } | ||
// }); | ||
// Blueshift.addEventListener('PushNotificationClickedEvent', () =>{}); | ||
// return () => { | ||
// console.log('useEffect: return'); | ||
// global.urlListener.remove(); | ||
// } | ||
// }, []) | ||
// return ( | ||
// <View style={{ flex: 1 }}> | ||
// <Text>Hello</Text> | ||
// </View> | ||
// ); | ||
// } | ||
// export default Root; |
declare module 'blueshift-react-native' { | ||
/** | ||
* Initialise the plugin components when React Native is ready and loaded. | ||
* | ||
* Usage - | ||
* Blueshift.init(); | ||
*/ | ||
function init(): void; | ||
/** | ||
* Add event listener for a event name to listen to events fired by Blueshift SDK | ||
@@ -5,0 +13,0 @@ * |
15
index.js
@@ -8,2 +8,17 @@ import { DeviceEventEmitter, Linking, NativeEventEmitter, NativeModules, Platform } from 'react-native'; | ||
/** | ||
* Initialize the components of the Blueshift SDK. This mainly initializes the | ||
* event emitter instance to start firing the events when the app is ready to | ||
* receive them. | ||
* | ||
* Usage - | ||
* Blueshift.init(); | ||
* | ||
*/ | ||
init: function() { | ||
if (Platform.OS === 'android') { | ||
NativeModules.BlueshiftBridge.init(); | ||
} | ||
}, | ||
/** | ||
* Add event listener for a event name to listen to events fired by Blueshift SDK | ||
@@ -10,0 +25,0 @@ * |
{ | ||
"name": "blueshift-react-native", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "React native plugin for Blueshift iOS and Android SDK.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2333765
13142
93
1