Package 

Interface ILocationManager


  • 
    public interface ILocationManager
    
                        

    The entry point to the location SDK for OneSignal.

    • Method Summary

      Modifier and Type Method Description
      abstract Boolean requestPermission() Use this method to manually prompt the user for location permissions.
      abstract Boolean getIsShared() Whether location is currently shared with OneSignal.
      abstract Unit setIsShared(Boolean isShared) Whether location is currently shared with OneSignal.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • requestPermission

         abstract Boolean requestPermission()

        Use this method to manually prompt the user for location permissions. This allows for geotagging so you send notifications to users based on location.

        Make sure you have one of the following permission in your AndroidManifest.xml as well.

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

        Be aware of best practices regarding asking permissions on Android: Requesting Permissions | Android Developers (https://developer.android.com/guide/topics/permissions/requesting.html)

      • getIsShared

         abstract Boolean getIsShared()

        Whether location is currently shared with OneSignal.

      • setIsShared

         abstract Unit setIsShared(Boolean isShared)

        Whether location is currently shared with OneSignal.