Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
The Android SDKs lower than 3.1.0 uses version 19.0.1 of the play-services-location library and it is not compatible with versions higher than 20.0.x. If you need to manually import this library, make sure it's one of the compatible versions.
Open the file build.gradle file of the application module (not the main project) on Android Studio. Add the following lines to import geouniq url repository
Add the following dependency
Replace x.y.z with a specific version of library that you can find here
The library already declare the basic permissions that needs, if your app meets the Google Play Store policies for background location, make sure you've declared permission to access background location:
The library already contains its ProGuard configuration file, which will be merged with your application's during the build process.
The Mobile Key generated for your app when you configured your project (see here) must be provided as a string resource with name "geouniq_mobile_key"
.
This can be done by putting the following line into the Gradle build script of your app (build.gradle file of your app module)
It could be convenient to set a different value for the debug and the relase build types.
Note that the certificates used for the two build types are generally different, and thus their SHA1 fingerprint will be different. For this reason, you should create two different Client Apps, one for the debug and one for the release build, each with its own fingerprint (see Project Configuration). A common solution is to create two different projects, one for test and one for production, and create an Android Client App on each project, using the debug fingerprint for the test project and the release fingerprint for the production project.
Before initializing the SDK, the below must be imported.
After import, add the below code under the Application class onCreate()
method. The SDK must be enabled before calling any of the other SDK methods.
As soon as the SDK starts for the first time, a Device ID is assigned to that specific installation of your app.
The Device ID assigned to an installation might change in case of rare events, for example if the local storage of the device gets erased.
The SDK provides two different ways to obtain the Device ID.
The first method to obtain the Device ID is to set a IDeviceIdListener
, as shown in the example below. When a listener is set, the SDK immediately returns the Device ID through the onDeviceIdAvailable()
callback if the Device ID is already available. Otherwise, it will call the callback method as soon as the ID is obtained.
The best practice for an app that want to collect on a backend systems the Device ID assigned to each installation, is to set a
IDeviceIdListener
each time it starts. The mobile app would receive the Device ID each time and should always send it to the backend system. Then, the backend system should overwrite any previously stored value if the new received value is different.
The second way is to call the GeoUniq.getDeviceId()
method. This method returns the value of the Device ID if it has already been obtained or null
if the Device ID has not been obtained yet.
The method GeoUniq.
getInstance(context).resetDeviceId()
reset the Device Id by invoking a new device registration.
The locations of interest, such as home and work locations, are places identified based on the visits detected by the SDK.
In order to track geofencing events, you need to initialize a user in your Cloud4Wi account.
The method to initialize users is exposed in the WiFi SDK, so you need to integrate also the WiFi SDK into your project.
Once both the WiFi and Location SDKs are installed you can use the following snippet to initialize the customer in Cloud4Wi as soon the deviceId
is assigned to the phone. This function will initialize an anonymous user without any additional attribute or personal data associated.
The SDK can be enabled and disabled at runtime. To make GeoUniq SDK start, you need to enable it by calling the method GeoUniq.enable()
at least once.
You might do that into the main activity of your app, as in the example below.
Once enabled, the SDK will not stop until you disable it by calling GeoUniq.disable()
. That is, it will keep performing automatic operations, such as tracking the device position, even after a device reboot or an update of the app. Disabling the SDK at runtime is useful if you want the SDK to stop completely. For example, you could remotely control a configuration parameter of your app to stop the SDK for all or some of your installations.
If you simply don't want GeoUniq to keep collecting location data for a specific User, you can do that without completely disabling the SDK (see ). This way you can still exploit the mobile-side functionalities that the SDK provides without having GeoUniq collecting data for the specific user
For the SDK to be able to accomplish its main task, that is tracking the device position, the following requirements must be met:
The foreground location permission must be granted to the app
The background location permission must be granted to the app, if it meets the Google Play Store policies for background location
The location functionality must be enabled on the device
Google Play Services must be installed on the device (almost always met)
The SDK provides a simple way for checking all the requirements and optionally solve the related issues. Solving an issue generally implies showing an alert to the User. Depending on the specific requirement, a different alert will be shown.
The example below shows hot to check for all requirements and solve them. In the example, the check is performed on the onStart()
method of the main activity
In the alternative, you can use the native WiFi SDK methods to .
Minor bug fix.
Added support to Android 14
Fixed proguard rule that prevent the obfuscation of client App.
Removed the static permission ACTIVITY_RECOGNITION.
The SDK now support play-services-location library versions higher 20.0.x.
Fixed proguard rule that prevent the obfuscation of client App.
Added trigger geofence when enter for the first time
Added API resetDeviceId()
Now you can change the base API url declaring the meta data
Removed fingerprint validation SDK side
Fixed bug in the trigger manager that caused an error when updating the remote trigger list
Added engine that allow the SDK to identify "Locations Of Interest" as "Home Location" and "Work Location"
Added engine that manage Triggers set by remote
Allows to get the work location calculated for this device.
Return a WorkLocation
object if work location is available or null otherwise.
Sets the listener class that will receive updates when the work location changes. The listener must be impIement the IWorkLocationListener interface.
Remove work location updates for the listener.
Allows to get the home location calculated for this device.
Return an HomeLocation
object if home location is available or null otherwise.
Sets the listener class that will receive updates when the home location changes.
The listener must be impIement the IHomeLocationListener
interface.
Remove home location updates for the listener.
To initialize the framework and allow it to collect data in the background it is necessary to add this call in the didFinishLaunchingWithOptions
method (this method don't start the tracking engine)
Add pod 'c4w-location-sdk'
to your Podfile and run pod install
. More details CocoaPods here.
Repository: https://github.com/Cloud4Wi-Create/iOS-LocationSDK-SwiftPackage
Create projects and apps in your console and get your mobile key
Add pod 'c4w-location-sdk'
to your Podfile and run pod install
. More details CocoaPods here.
For other integration methods see here
Add the following key to Info.plist file (String value) with the corresponding value (that you obtained when added your app to your project)
Add the following keys to Info.plist file (String value), the corresponding values will be shown to the user by iOS
To initialize the framework and allow it to collect data in the background it is necessary to add this call in the didFinishLaunchingWithOptions
method (this method don't start the tracking engine)
To start the tracking engine call enable method.
Example:
The method GeoUniq.sharedInstance().getDeviceId()
return the id relative to the device if it has been registered, nil otherwise.
The method GeoUniq.sharedInstance().resetDeviceId()
reset the Device Id by invoking a new device registration.
The locations of interest, such as home and work locations, are places identified based on the visits detected by the SDK.
Add the following key to Info.plist file (String value) with the corresponding value (that you obtained when added your app to your project)
Add the following keys to Info.plist file (String value), the corresponding values will be shown to the user by iOS
If your app supports iOS add
Add the following key to Info.plist file (String value), it will be used to show a popup to the user before the provided by iOS. Only if the user accepted this first popup we request the permission to iOS.
In order to obtain a greater number of positions we suggest to enable this feature. To do this carry out these two steps:
Select your project -> Select your target -> Select 'Signing & Capabilities' tab -> tap on '+ Capability' -> select 'Background Modes' -> check 'Background fetch'
In AppDelegate add this code:
iOS 14 introduced the permission request to get the device's IDFA. In this regard, we have introduced two methods in our framework.
The first one checking the permission status:
And the second one that makes the request and returns the user's choice:
It is possible to use these methods but also the methods provided directly by iOS. There is no need to communicate to our framework the outcome of the permission. Invoke the request method as soon as possible. For example right after the enable.
Important: Before invoking the method for the request (both Geouniq and iOS) it is necessary to insert the key in the plist
In order to track geofencing events, you need to initialize a user in your Cloud4Wi account.
The method to initialize users is exposed in the WiFi SDK, so you need to integrate also the WiFi SDK into your project.
Once both the WiFi and Location SDKs are installed you can use the following snippet to initialize the customer in Cloud4Wi as soon the deviceId
is assigned to the phone. This function will initialize an anonymous user without any additional attribute or personal data associated.
To start the tracking engine call enable method. You can do that into the didFinishLaunchingWithOptions
method. It is possible to enable directly the tracking engine when the initialize method is called. Once enabled, the SDK will not stop until you disable it by calling GeoUniq.sharedInstance().disable()
If the application does not have the permissions or has not yet requested them, the enable method will request them.
In the alternative, you can use the native WiFi SDK methods to .
13.3
5.2 with "Build Libraries for Distribution" enabled (in case of updating the swift version of the app it isn't necessary to update the framework).
3.0.0 - Changelog
The geofence entry event is triggered in all conditions ( even when the user downloads and installs the app and he is inside the geofence)
----------------------------------------------------------
Return strings instead enum on tracking trasparency methods
----------------------------------------------------------
Fix on geofence paths
----------------------------------------------------------
Delete warning on location manager
----------------------------------------------------------
Possibility to reset the device id (new registration)
----------------------------------------------------------
Delete background task warning
Mitigation error FRONTBOARD 2343432205
----------------------------------------------------------
Minor bug fixes
----------------------------------------------------------
LOI
Trigger
Minor bug fixes