OneSignal-Flutter-SDK icon indicating copy to clipboard operation
OneSignal-Flutter-SDK copied to clipboard

[question]: Problem with geolocation

Open Samuelg0ld opened this issue 11 months ago • 4 comments

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

  • [X] I agree to follow this project's Code of Conduct

Samuelg0ld avatar Mar 20 '24 15:03 Samuelg0ld

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

Samuelg0ld avatar Mar 20 '24 19:03 Samuelg0ld

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

nan-li avatar Apr 02 '24 19:04 nan-li

Yeah i tried it but it not working.

Samuelg0ld avatar Apr 02 '24 19:04 Samuelg0ld

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.** { *; }

FullstackWEB-developer avatar Aug 14 '24 12:08 FullstackWEB-developer