Location Opt-In Prompt

Viewed 24
 void _handleSetLocationShared() {
print("Paylaşılan konumu true olarak ayarlama");
OneSignal.shared.setLocationShared(true);

}

 TableRow(children: [
         OneSignalButton("Paylaşılan Konumu Ayarla",
            _handleSetLocationShared, !_enableConsentButton)
      ])

My OneSignal Inapp message image

* I Get Error In Apply The Error I Get: "Location Unavailable It seems there are no location services configured in this app. Please refer to the OneSignal documentation for more information.* Picture of the Error I Get

1 Answers

Add the following code to debug/AndroidManifest.xml and profile/AndroidManifest.xml

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

Add the following code to the main.dart file

OneSignal.shared.addTrigger("location_prompt", "true");

and then set the image from OneSignal OneSignal image

Related