Commit 6065aa4
authored
Fix setLocationShared for Wrapper SDK's (#403)
• Most OneSignal Wrapper SDK's call init() twice, the first time calls it with a nil appID as the first initialization step, and then init() gets called later on as the wrapper runtime (ie. the React Native runtime) is loaded and initialized
• The problem with this approach is that the SDK also checks to see if it should start sharing location in init()
• So when init() gets called automatically with a nil app ID by wrapper SDK's (before the runtime is loaded), the SDK started sharing location
• This meant location was shared even if developers later on called setLocationShared(false), even if they call it before they called init() with their app ID
• This commit fixes the issue by checking to make sure the app ID exists before checking if it should share location
• Init needs to be refactored in general to be simpler, but this should work as a quick fix.1 parent 0e6f3ab commit 6065aa4
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
423 | 423 | | |
424 | 424 | | |
425 | 425 | | |
426 | | - | |
| 426 | + | |
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
| |||
0 commit comments