CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.
TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | BSD |
ReleasedLast Release | Jun 2016 |
Maintained by Jun Liu.
Check here for Omniata integration documentation.
Omniata iOS SDK is implemented using Objective-C. By default SDK does not log anything, i.e. uses SMT_LOG_NONE log level. The method setLogLevel of iOmniataAPI can be used to adjust the log level. When developing and testing a more verbose log level might be useful.
Note the SDK uses NSMutableURLRequest class for the Channel API & Event API communication. The class is rather limited, it doesn't allow setting connection timeout or request timeout.
This version is compatible with the previous version v2.0.0. Changed details: Change the debug level to be unified with Android (for Unity usage).
The iOS SDK automatic adds Event Parameters in om_load events:
size_t size;
sysctlbyname("hw.machine", NULL, &size, NULL, 0);
char *machine = malloc(size);
sysctlbyname("hw.machine", machine, &size, NULL, 0);
NSString *platform = [NSString stringWithUTF8String:machine];
free(machine);
return platform;
Include this header when using iOmnitaAPI
#import <iOmniataAPI/iOmniataAPI.h>
Initialization methods can be safely called multiple times or from multiple threads simultaneously, however only the first call initializes. The subsequent calls are ignored. is the organization part of the URL you use to access Omniata Panel, i.e. https://organization.panel.omniata.com -> would be organization.
NSString * api_key = @"<API_KEY>";
NSString * user_id = @"<USER_ID>";
NSString * org = @"<ORG_NAME>";
[iOmniataAPI initializeWithApiKey:api_key api_key: UserId:user_id OrgName:org]; // Tracks against production API
iOS SDK now only supports one time initialization. But the api key and uid can be reset by using the following method. And the after tracking events will use the updated api_key and user_id instead.
[iOmniataAPI setApiKey:api_key];
[iOmniataAPI setUserId:user_id];
[iOmniataAPI trackLoadEvent];
[iOmniataAPI trackPurchaseEvent:99.9 currency_code: @"EUR"];
NSDictionary *dictionary = [[NSDictionary alloc] initWithObjectsAndKeys:
@"21", @"cash_balance",
@"7", @"level",
nil];
[iOmniataAPI trackEvent: @”quest_complete”: dictionary];
[iOmniataAPI trackAdvertiserID];
A Channel API request is made by calling loadMessages. Internally the SDK calls the Channel API using HTTP. The call is asynchronously make using [NSURLConnection sendAsynchronousRequest]. The completionBlock that is given as a parameter to loadMessages is called after the Channel API call finished. In the successful case the messages can be retrieved using getChannelMessages. Currently, maximum one Channel API call can be in progress at time.
[iOmniataAPI loadMessagesForChannel:40 completionHandler:^(OMT_CHANNEL_STATUS cs){
NSArray* message = [iOmniataAPI getChannelMessages];
}];
[iOmniataAPI setLogLevel:SMT_LOG_VERBOSE];
- (void)applicationDidFinishLaunching:(UIApplication *)app {
// other setup tasks here....
// Initialize OmniataSDK
[iOmniataAPI initializeWithApiKey:@"<API_KEY>" UserId:@"<USER_ID>" AndDebug:YES]; // Tracks to test API
// Register for notifications here
// For iOS 8 and later, do the UIUserNotificationSettings setting
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
if ([[UIApplication sharedApplication] respondsToSelector:@selector(registerUserNotificationSettings:)]) {
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:settings];
[[UIApplication sharedApplication] registerForRemoteNotifications];
} else {
[[UIApplication sharedApplication] registerForRemoteNotificationTypes: UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge];
}
// For iOS version less than iOS 8
#else
[[UIApplication sharedApplication] registerForRemoteNotificationTypes: UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge];
#endif
return YES;
}
[iOmniataAPI initializeWithApiKey:@"<API_KEY>" UserId:@"<USER_ID>" OrgName:<ORG>];
...
[iOmniataAPI enablePushNotifications:deviceToken];
To disable via Omniata SDK, calling this method will tell Omniata that the user is no longer eligible to receive push notifications.
[iOmniataAPI disablePushNotifications];
pod lib lint
push to pod trunk
git commit -m "Release 2.2.2"
git tag '2.2.2'
git push --tags
pod trunk register
pod trunk push omniata-ios-sdk.podspec
3rd party software licenses. SBJson is used for JSON processing, check detail of the LICENSE file in the repository