fuse-open / fuselibs

Fuselibs is the Uno-libraries that provide the UI framework used in Fuse apps
https://npmjs.com/package/@fuse-open/fuselibs
MIT License
176 stars 72 forks source link

GeoLocation Upgrade #1344

Closed AndrewEQ closed 4 years ago

AndrewEQ commented 4 years ago

Updates

Requires Uno PR: https://github.com/fuse-open/uno/pull/285

Enabling Background Location:

Android: Android < Android Q: Can customize notification icon & color Android Q+: uses app icon

"Android": {
    "GeoLocation": {
        "RequestPermissionsOnLaunch": false,
        "BackgroundLocation": {
          "Enabled": true,
          "NotificationIcon": {
            "Color": "#FF4855",
            "LDPI": "Assets/android/notification_icon@LDPI.png",
            "MDPI": "Assets/android/notification_icon@MDPI.png",
            "HDPI": "Assets/android/notification_icon@HDPI.png",
            "XHDPI": "Assets/android/notification_icon@XHDPI.png",
            "XXHDPI": "Assets/android/notification_icon@XXHDPI.png",
            "XXXHDPI": "Assets/android/notification_icon@XXXHDPI.png"
          }
        }
    },
...

iOS: For getting the location in the background, iOS Needs the Background Modes Location Updates to be set, this setting will be added to Uno via a PR(https://github.com/fuse-open/uno/pull/285).

"iOS": {
    "BackgroundModes": true,
    "SystemCapabilities": {
      "Location": true
    },
...

Don't forget to set your plist for the permission messages:

"iOS": {
    "PList" : {
      "NSLocationUsageDescription": "Enable Background Location to get your location in the background for tracking your whereabouts.",
      "NSLocationAlwaysUsageDescription": "Enable Background Location to get your location in the background for tracking your whereabouts.",
      "NSLocationWhenInUseUsageDescription": "Enable Background Location to get your location in the background for tracking your whereabouts."
    },
...

Packages:

  "Packages": [
    "Fuse",
    "FuseJS",
    "Fuse.GeoLocation",
  ],