OneSignal / react-native-onesignal

React Native Library for OneSignal Push Notifications Service
Other
1.57k stars 373 forks source link

sendTags not saving #275

Closed triplehenry closed 7 years ago

triplehenry commented 7 years ago

I am calling OneSignal.sendTags({...}) on the callback for ids when there is a value for pushToken. This happens during the signup process when the user initially accepts the push notification prompt which gets triggered by OneSignal.registerForPushNotifications(). Yet, when I check the dashboard, I do not see the tags being saved. I've noticed that sometimes if I restart the app, the tags would show up on the dashboard due to the same callbacks. Not sure if there is a race condition or if I'm calling sendTags incorrectly. Thanks in advance for your help.

alexgsummer commented 7 years ago

@triplehenry I had the same issue with iOS. Sending tags on Android works fine. If you follow the instructions here to update the OneSignal native code to version 2.5.4, sendTags and sendTag will both work consistently. Hope that helps save you the hours and hours I spent trying to figure this out.

feiyingx commented 7 years ago

@alexgsummer u da real MVP

triplehenry commented 7 years ago

@alexgsummer Thank you so much. It worked!

weixiyen commented 7 years ago

@avishayil would it be possible to update the default SDK that gets installed to node_modules to fix this bug for iOS?

avishayil commented 7 years ago

Yes, I will update the SDK.

zyan-dev commented 7 years ago

Dear, alexgsummer. Should I update the SDK manually? I changed "react-native-onesignal": "^3.0.4" to "react-native-onesignal": "^2.5.4" and run "npm install", but not work correctly.

alexgsummer commented 7 years ago

@smart-mickey, updating the version in your package.json and running npm install doesn't seem to update the files in the XCode project, so updating the SDK manually should fix your issue. Also, the version mentioned above (2.5.4) is referencing the OneSignal Native SDK and not this project.

@avishayil, what's the recommended steps to get XCode to "see" the new SDK files in node_modules after you bump the version? Is it necessary to manually copy the files?

zyan-dev commented 7 years ago

thanks for your quick reply. I will unlink and uninstall latest version of this package and reinstall @2.5.4. Do you think this will work?

kivannc commented 7 years ago

Hello I've installed the latest version (3.0.4). But sendTag or sendTags methods are not working. I can't see changes on onesignal dashboard. I tried to get them with getTags method. it returns an empty object.

alexgsummer commented 7 years ago

The version for this lib has not been bumped nor has an update been published to NPM since merging in the updated OneSignal iOS SDK files. Our work-around is still my suggestion above to manually update the OneSignal SDK files. If you don't want to do that, you could also temporarily point to the master branch in your package.json:

"react-native-onesignal": "geektimecoil/react-native-onesignal#master"
modularity commented 6 years ago

What is the status on this? sendTag is not working with my project that runs OneSignal@3.0.5

CalebRoyer commented 6 years ago

+1