File tree Expand file tree Collapse file tree 3 files changed +27
-0
lines changed
Expand file tree Collapse file tree 3 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -201,6 +201,11 @@ class _MyAppState extends State<MyApp> {
201201 OneSignal .Location .setShared (true );
202202 }
203203
204+ void _handleRequestLocationPermission () {
205+ print ("Requesting location permission" );
206+ OneSignal .Location .requestPermission ();
207+ }
208+
204209 void _handleGetExternalId () async {
205210 var externalId = await OneSignal .User .getExternalId ();
206211 print ('External ID: $externalId ' );
@@ -397,6 +402,10 @@ class _MyAppState extends State<MyApp> {
397402 new OneSignalButton ("Set Location Shared" ,
398403 _handleSetLocationShared, ! _enableConsentButton)
399404 ]),
405+ new TableRow (children: [
406+ new OneSignalButton ("Request Location" ,
407+ _handleRequestLocationPermission, ! _enableConsentButton)
408+ ]),
400409 new TableRow (children: [
401410 new OneSignalButton (
402411 "Remove Tag" , _handleRemoveTag, ! _enableConsentButton)
Original file line number Diff line number Diff line change @@ -201,6 +201,11 @@ class _MyAppState extends State<MyApp> {
201201 OneSignal .Location .setShared (true );
202202 }
203203
204+ void _handleRequestLocationPermission () {
205+ print ("Requesting location permission" );
206+ OneSignal .Location .requestPermission ();
207+ }
208+
204209 void _handleGetExternalId () async {
205210 var externalId = await OneSignal .User .getExternalId ();
206211 print ('External ID: $externalId ' );
@@ -397,6 +402,10 @@ class _MyAppState extends State<MyApp> {
397402 new OneSignalButton ("Set Location Shared" ,
398403 _handleSetLocationShared, ! _enableConsentButton)
399404 ]),
405+ new TableRow (children: [
406+ new OneSignalButton ("Request Location" ,
407+ _handleRequestLocationPermission, ! _enableConsentButton)
408+ ]),
400409 new TableRow (children: [
401410 new OneSignalButton (
402411 "Remove Tag" , _handleRemoveTag, ! _enableConsentButton)
Original file line number Diff line number Diff line change @@ -201,6 +201,11 @@ class _MyAppState extends State<MyApp> {
201201 OneSignal .Location .setShared (true );
202202 }
203203
204+ void _handleRequestLocationPermission () {
205+ print ("Requesting location permission" );
206+ OneSignal .Location .requestPermission ();
207+ }
208+
204209 void _handleGetExternalId () async {
205210 var externalId = await OneSignal .User .getExternalId ();
206211 print ('External ID: $externalId ' );
@@ -397,6 +402,10 @@ class _MyAppState extends State<MyApp> {
397402 new OneSignalButton ("Set Location Shared" ,
398403 _handleSetLocationShared, ! _enableConsentButton)
399404 ]),
405+ new TableRow (children: [
406+ new OneSignalButton ("Request Location" ,
407+ _handleRequestLocationPermission, ! _enableConsentButton)
408+ ]),
400409 new TableRow (children: [
401410 new OneSignalButton (
402411 "Remove Tag" , _handleRemoveTag, ! _enableConsentButton)
You can’t perform that action at this time.
0 commit comments