Skip to content

Instantly share code, notes, and snippets.

View tssandor's full-sized avatar

TSS tssandor

View GitHub Profile
CREATE EXTERNAL TABLE <your-dbname>.<table-name> (
`device_id` string,
`id_type` string,
`latitude` float,
`longitude` float,
`horizontal_accuracy` float,
`timestamp` bigint,
`ip_address` string,
`device_os` string,
`os_version` string,
#import <UIKit/UIKit.h>
@import QDPublisher;
@interface AppDelegate : UIResponder <UIApplicationDelegate,
PublisherDelegate>
@end
#import "AppDelegate.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
NSString *integrationKey = @"your integration key here";
- (BOOL)application:(UIApplication *)application
extension AppDelegate: PublisherDelegate {
/// this method called when failure to track location
func publisherOnError(error: Error) {
print("track location failed, error: \(error.
localizedDescription)")
}
/// this method called when location successfully tracked
func publisherOnSuccessTracking() {
import QDPublisher
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
let publisher = Publisher.shared
let integrationKey: String = "your integration key here"
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.
// USE Constans.PRIORITY_HIGH_ACCURACY:
// to request the most accurate locations available.
// This will return the finest location available.
// OR Constans.PRIORITY_BALANCED_POWER_ACCURACY:
// to request "block" level accuracy.
// Block level accuracy is considered to be about 100 meter accuracy.
// Using a coarse accuracy such as this often consumes less power.
Client.getInstance().startTrackingLocation(this,
// USE Constans.PRIORITY_HIGH_ACCURACY:
// to request the most accurate locations available.
// This will return the finest location available.
// OR Constans.PRIORITY_BALANCED_POWER_ACCURACY:
// to request "block" level accuracy.
// Block level accuracy is considered to be about 100 meter accuracy.
// Using a coarse accuracy such as this often consumes less power.
Client.getInstance().startTrackingLocation(this,
Client.getInstance().setup(this,
true,
"YOUR INTEGRATION KEY",
object : Client.ResultCallback {
override fun onSuccess(result: String) {
}
override fun onError(result: String) {
Client.getInstance().setup(this,
true,
"YOUR INTEGRATION KEY",
new Client.ResultCallback() {
@Override
public void onSuccess(String result) {
}
@Override
multiDexEnabled true