OneSignal / OneSignal-Flutter-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your flutter app with OneSignal
https://www.onesignal.com
Other
623 stars 212 forks source link

[question]: Problem with geolocation #859

Open Samuelg0ld opened 8 months ago

Samuelg0ld commented 8 months ago

How can we help?

Hi i have problem with OneSignal geolocation. In my app i made request for geolocation and if geolocation is accepted i will set OneSignal.Location.setShared(true);

Everything works fine in emulator, but when i made build apk and then download apk to my real device, on the real device i accepted geolocation and after that nothing happened. In one signal i saw that i have new subsciption but in location point was nothing...

Code of Conduct

Samuelg0ld commented 8 months ago

UPDATE - i tried some ways and i found that if i install apk-debug.apk it works fine but if i install apk-release.apk OneSignal.location not working - PLEASE HELP ME FIX

nan-li commented 7 months ago

Hey @Samuelg0ld thanks for reporting. Can you test with obfuscation off? Curious if this makes a difference. See this comment on how: https://github.com/OneSignal/OneSignal-Flutter-SDK/issues/713#issuecomment-1692991176

Samuelg0ld commented 7 months ago

Yeah i tried it but it not working.

FullstackWEB-developer commented 3 months ago

I had same issue so I added this code to proguard-rule.pro and then it's also working on release mode

# Keep location-related classes and methods
-keep class com.google.android.gms.location.** { *; }
-keep class com.google.android.gms.common.api.** { *; }
-keep class com.google.android.gms.tasks.** { *; }