-
Notifications
You must be signed in to change notification settings - Fork 2
6. Native Components
RokwirePlugin provides access to the functionality that needs to be handled natively for Android and iOS because it is not supported by Flutter libraries and plugins. It uses MethodChannel to access the native implementations. It exposes the following APIs:
This is a test API that came with the default plugin created by Flutter. It returns the operating system version on the device.
Creates an Android notification channel for local notifications that is provided to Firebase messaging library. This API is handled in the Android Native side only.
Presents a local notification. Used to inform the user about asynchronous events when the application is inactive or resides in the background.
Dismisses the current modal instance of SFSafariViewController
. This API is handled in iOS Native side only. Used to dismiss the SFSafariViewController
instance that remains on top of the screen after successful OIDC login in iOS.
Returns a UUID that uniquely identifies the device. This value is preserved across application reinstallations.
Similarly to getDeviceId this API initializes a block of memory with random data and stores it in the permanent device storage. Used to generate and store securely AES encryption keys.
Launches external application by deep link URL.
Launches system settings application initialized to this application settings page.
This API is a gateway to query authorization status and request permission to access device location services.
Similarly to locationServices this API is a gateway to query authorization status and request permission to track user activity in web browsers. This API is implemented only in iOS.
This API is a gateway to access GeoFence native service. It is used to monitor whether the user is inside previously defined regions, as well as for BLE beacons ranging.
RokwirePlugin handles the simple APIs and provides gateway access to location, tracking and geofence services.
Dispatches the Android version number as defined in android.os.Build.VERSION.RELEASE.
Creates a notification channel with the requested parameters (ID, name, description, importance) and registers it in the system notification manager. The Native side keeps an instance of this notification channel that is used when presenting notifications from showNotification
API.
Creates a local notification populated with the requested parameters (title, body). Uses the system notification manager to present the notification in the notification channel created by createAndroidNotificationChannel API.
Not available in Android.
Returns Settings.Secure.ANDROID_ID value formatted as UIUD.
Returns a base 64 encoded string that contains a randomly generated block of memory stored in encrypted shared application preferences.
Starts an activity identified by Intent.ACTION_VIEW
deep link intent.
Starts settings activity identified by Settings.ACTION_APPLICATION_DETAILS_SETTINGS
intent.
LocationServices manages application authorization for accessing location services. The “method” parameter takes the following values that determine the requested service:
Queries the current permission status from LocationManager
or Secure Settings
based on the device’s OS version.
Requests location services permission for ACCESS_FINE_LOCATION
and ACCESS_COARSE_LOCATION
.
Tracking services are not supported in Android.
GeofenceMonitor service is responsible for monitoring regions and ranging beacons.
The service monitors if the device is in a specific region based on android internal GeofencingClient
(for location regions) and BeaconManager
(for beacon regions). For monitoring beacon regions, the services uses third party SDK: AltBeacon - Android Beacon Library. GeofenceMonitor begins to monitor regions on app startup. When a region is entered or exited, the service sends a notification to Flutter.
- entering in region - geo_fence.regions.changed and geo_fence.regions.enter
- exiting from region - geo_fence.regions.changed and geo_fence.regions.exit
The service could start or stop to range beacons only if the device is inside the specified region. For ranging beacons, the service uses third party SDK Altbeacon. When a beacon is successfully ranged, the service send notification to flutter side - geo_fence.beacons.changed with the ranged beacons as parameters.
Simple string utilities for null/empty checks and conversion of hexadecimal strings to byte array and vice versa.
Utility class to access nested maps fields by path keys.
Utility class for encoding and decoding Base64 encoded strings.
Utility class for enhanced access to shared application preferences.
Utility class for enhanced access to secure shared application preferences.
Utility class for working with collections of ALT beacons.
RokwirePlugin handles the simple APIs and provides gateway access to location, tracking and geofence services.
Dispatches the iOS version number as defined in UIDevice.systemVersion
API.
Not available in iOS
Creates a notification request populated with the requested parameters (title, body, sound) and uses UNUserNotificationCenter to present the notification request.
Gets the currently presented view controller and if it is an instance of SFSafariViewController
dismisses it. Used for dismissing the OIDC login web panel after successful login.
Returns a randomly generated UUID that is stored securely in the device keychain.
Returns a base 64 encoded string that contains a randomly generated block of memory stored securely in the device keychain.
Opens an URL identified by deep link parameter.
Opens an URL identified by UIApplicationOpenSettingsURLString
.
LocationServices manages application authorization for accessing location services. The “method” parameter takes the following values that determine the requested service:
Queries the current authorization status from CLLocationManager
without requesting any authorization.
Requests location services authorization from CLLocationManager
.
TrackingServices manage authorization for accessing tracking authorization. The “method” parameter takes the following values that determine the requested service:
Queries the current authorization status from ATTrackingManager
without requesting any authorization.
Requests tracking authorization from ATTrackingManager
.
The native iOS geofence service is handled in RegionMonitor
class. It uses CLLocationManager
for region monitor and beacon ranging. This service exposes the following APIs:
Queries the regions that the user is currently inside.
Gets or sets the current set of regions to be monitored by the service.
Starts ranging for beacons in a regions.
Stops ranging for beacons in a regions.
Queries the currently detected beacons in a region.
The service fires the following notifications towards Flutter side:
When the set of monitored regions the user is currently inside gets changed.
When the user enters a monitored region.
When the user exits a monitored region.
Then the set of currently detected beacons in a beacon monitored region gets changed.
This is a NSDictionary
extension for type safe access to dictionary fields. Used for type safe access of JSON object members.
This is a NSString
extension for type safe parsing JSON strings.
This is a NSObject
extension for JSON data serialization to string..
Provides helpers to access the secure device storage.