Skip to content

Instantly share code, notes, and snippets.

@nileshtrivedi
Last active January 8, 2019 12:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nileshtrivedi/2857d802ba76af7fa23e904a1ed80ab6 to your computer and use it in GitHub Desktop.
Save nileshtrivedi/2857d802ba76af7fa23e904a1ed80ab6 to your computer and use it in GitHub Desktop.
HyperTrack Onboarding
// Import the SDK within your repositories block
repositories {
maven { url 'http://hypertrack-core-android.s3-website-us-east-1.amazonaws.com/' }
...
}
//Add HyperTrack as a dependency
dependencies {
compile("com.hypertrack.core:android:0.8.13@aar"){
transitive = true;
}
...
}
pod 'HyperTrackCore'
// Make sure to go to the Info tab in your app settings
// and add permission strings for "Privacy - Location Always Usage Description"
// and "Privacy - Motion Usage Description"
[HTCore requestLocationPermissionWithCompletionHandler:^(HTCoreError * _Nullable error) {
/// handle error if any
}];
[HTCore requestActivityPermissionWithCompletionHandler:^(HTCoreError * _Nullable error) {
/// handle error if any
}];
// Make sure to go to the Info tab in your app settings
// and add permission strings for "Privacy - Location Always Usage Description"
// and "Privacy - Motion Usage Description"
HyperTrackCore.requestLocationPermission { (error) in
/// handle error if any
}
HyperTrackCore.requestActivityPermission { (error) in
/// handle error if any
}
[HTCore initializeWithPublishableKey:@"PUBLISHABLE-KEY" completionHandler:^(HTCoreError * _Nullable error) {
/// perform post initialization actions
/// handle error if any
}];
HyperTrackCore.initialize(publishableKey: PUBLISHABLE-KEY) { (error) in
/// perform post initialization actions
/// handle error if any
}
HyperTrackCore.requestLocationPermissions(this, new LocationPermissionCallback() {
@Override
public void onLocationPermissionGranted() {
// Handle location permission granted
}
@Override
public void onLocationPermissionDenied() {
// Handle location permission denied
}
});
//Initialize the SDK within the onCreate method
public void onCreate() {
super.onCreate();
HyperTrackCore.initialize(this, PUBLISHABLE_KEY);
...
}
pod 'HyperTrackCore'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment