diff --git a/examples/RNOneSignal/.yarnclean b/examples/RNOneSignal/.yarnclean new file mode 100644 index 00000000..3d1e1cd5 --- /dev/null +++ b/examples/RNOneSignal/.yarnclean @@ -0,0 +1,44 @@ +# test directories +__tests__ +test +tests +powered-test + +# asset directories +docs +doc +website +images + +# examples +example +examples + +# code coverage directories +coverage +.nyc_output + +# build scripts +Makefile +Gulpfile.js +Gruntfile.js + +# configs +appveyor.yml +circle.yml +codeship-services.yml +codeship-steps.yml +wercker.yml +.tern-project +.gitattributes +.editorconfig +.*ignore +.eslintrc +.jshintrc +.flowconfig +.documentup.json +.yarn-metadata.json +.travis.yml + +# misc +*.md diff --git a/examples/RNOneSignal/App.js b/examples/RNOneSignal/App.js index 8e649139..fc8f693d 100644 --- a/examples/RNOneSignal/App.js +++ b/examples/RNOneSignal/App.js @@ -128,12 +128,21 @@ export default class App extends Component { // Create a set of triggers in a map and add them all at once var triggers = { trigger2: '2', - trigger3: '3', + trigger3: true, }; OneSignal.addTriggers(triggers); + // Get trigger value for the key + OneSignal.getTriggerValueForKey('trigger3') + .then(response => { + console.log('trigger3 value: ' + response); + }) + .catch(e => { + console.error(e); + }); + // Create an array of keys to remove triggers for - var removeTriggers = ['trigger2', 'trigger3']; + var removeTriggers = ['trigger1', 'trigger2']; OneSignal.removeTriggersForKeys(removeTriggers); } diff --git a/index.js b/index.js index c2e81e3f..db96b5b1 100644 --- a/index.js +++ b/index.js @@ -351,7 +351,10 @@ export default class OneSignal { static postNotification(contents, data, player_id, otherParameters) { if (!checkIfInitialized()) return; - RNOneSignal.postNotification(contents, data, player_id, otherParameters); + if (Platform.OS === 'android') + RNOneSignal.postNotification(JSON.stringify(contents), JSON.stringify(data), JSON.stringify(player_id), JSON.stringify(otherParameters)); + else + RNOneSignal.postNotification(contents, data, player_id, otherParameters); } static clearOneSignalNotifications() { diff --git a/ios/libOneSignal.a b/ios/libOneSignal.a index 2daed671..4e3aaa94 100644 Binary files a/ios/libOneSignal.a and b/ios/libOneSignal.a differ diff --git a/package.json b/package.json index 5e0982ac..546f3d89 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-onesignal", - "version": "3.6.2", + "version": "3.6.3", "description": "React Native OneSignal SDK", "main": "index", "scripts": { diff --git a/react-native-onesignal.podspec b/react-native-onesignal.podspec index 34aee294..879be0fd 100644 --- a/react-native-onesignal.podspec +++ b/react-native-onesignal.podspec @@ -22,5 +22,5 @@ Pod::Spec.new do |s| # pod 'React', :path => '../node_modules/react-native/' # The Native OneSignal-iOS-SDK from cocoapods. - s.dependency 'OneSignal', '2.12.4' + s.dependency 'OneSignal', '2.12.5' end