react-native-onesignal
Advanced tools
Comparing version
17
index.js
@@ -7,3 +7,3 @@ /** | ||
import { NativeModules, DeviceEventEmitter } from 'react-native'; | ||
import { NativeModules, DeviceEventEmitter, NetInfo } from 'react-native'; | ||
@@ -46,2 +46,7 @@ const { RNOneSignal } = NativeModules; | ||
Notifications.registerForPushNotifications = function(){ | ||
RNOneSignal.registerForPushNotifications(); | ||
} | ||
Notifications._onNotificationOpened = function(message, data, isActive) { | ||
@@ -88,5 +93,11 @@ if ( this.onNotificationOpened === false ) { | ||
Notifications.idsAvailable = function(idsAvailable) { | ||
RNOneSignal.idsAvailable(idsAvailable); | ||
NetInfo.isConnected.fetch().then(isConnected => { | ||
if (isConnected == true) { | ||
RNOneSignal.idsAvailable(idsAvailable); | ||
} | ||
else { | ||
return; | ||
} | ||
}); | ||
} | ||
@@ -93,0 +104,0 @@ |
{ | ||
"name": "react-native-onesignal", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "React Native OneSignal Component", | ||
@@ -5,0 +5,0 @@ "main": "index", |
@@ -71,20 +71,2 @@ # React Native OneSignal | ||
In `node_modules/react-native-onesignal/android/build.gradle` | ||
```gradle | ||
... | ||
android { | ||
... | ||
defaultConfig { | ||
... | ||
manifestPlaceholders = [manifestApplicationId: "${applicationId}", | ||
onesignal_app_id: "YOUR_ONESIGNAL_ID", | ||
onesignal_google_project_number: "YOUR_GOOGLE_PROJECT_NUMBER"] | ||
} | ||
} | ||
``` | ||
That step is neccesary right now due to OneSignal SDK tests being performed at build. until we'll find a better solution you'll have to include this snippet twice, Once in your app build.gradle and in the module build.gradle as well. | ||
Register module (in `MainActivity.java`) | ||
@@ -117,3 +99,3 @@ | ||
* Follow the steps according the official OneSignal SDK Installation here: https://documentation.onesignal.com/docs/installing-the-onesignal-ios-sdk | ||
* Follow the steps according to the official OneSignal SDK Installation here: https://documentation.onesignal.com/docs/installing-the-onesignal-ios-sdk | ||
* Make sure you installed the OneSignal Pod. | ||
@@ -120,0 +102,0 @@ * Once you've finished, Open your project in Xcode. |
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
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
1
-50%100
25%3334846
-60.49%24
-68%469
-30%299
-5.68%