-
Notifications
You must be signed in to change notification settings - Fork 14
Closed
Description
When asking for precise location permission on Android, app would crash when user selects allow once or allow while using. (not an issue on IOS)
Current function
@ReactMethod
fun setSiftConfig(accountId: String, beaconKey: String, disallowCollectingLocationData: Boolean,
serverUrlFormat: String) {
siftConfig = if (TextUtils.isEmpty(serverUrlFormat)) {
Sift.Config.Builder()
.withAccountId(accountId)
.withBeaconKey(beaconKey)
.build()
} else {
Sift.Config.Builder()
.withAccountId(accountId)
.withBeaconKey(beaconKey)
.withServerUrlFormat(serverUrlFormat)
.build()
}
Sift.open(reactApplicationContext, siftConfig)
Sift.collect()
}
setSiftConfig seems to be missing the .withDisallowLocationCollection(disallowCollectingLocationData) chained method when calling .Builder
When I added that everything worked as expected
Suggested change
@ReactMethod
fun setSiftConfig(accountId: String, beaconKey: String, disallowCollectingLocationData: Boolean,
serverUrlFormat: String) {
siftConfig = if (TextUtils.isEmpty(serverUrlFormat)) {
Sift.Config.Builder()
.withAccountId(accountId)
.withBeaconKey(beaconKey)
.withDisallowLocationCollection(disallowCollectingLocationData)
.build()
} else {
Sift.Config.Builder()
.withAccountId(accountId)
.withBeaconKey(beaconKey)
.withServerUrlFormat(serverUrlFormat)
.withDisallowLocationCollection(disallowCollectingLocationData)
.build()
}
Sift.open(reactApplicationContext, siftConfig)
Sift.collect()
}
Metadata
Metadata
Assignees
Labels
No labels