@interface Teak
TODO!
Methods
- identifyUser:
Tell Teak how to identify the current user.
- (void)identifyUser:(NSString *)userId;
This will also begin tracking and reporting of a session, and track a daily active user. This functionality is also accessable from the C API:
extern void TeakIdentifyUser(const char* userId,
const char* userConfigurationJson);
This should be how you identify the user in your back-end. |
- identifyUser:withEmail:
Use identifyUser:withConfiguration: instead |
Tell Teak how to identify the current user.
- (void)identifyUser:(NSString *)userId
withEmail:(NSString *)email;
This will also begin tracking and reporting of a session, and track a daily active user. This functionality is also accessable from the C API:
extern void TeakIdentifyUser(const char* userId,
const char* userConfigurationJson);
This should be how you identify the user in your back-end. |
- identifyUser:withOptOutList:
Use identifyUser:withConfiguration: instead |
Tell Teak how to identify the current user, with data collection opt-out.
- (void)identifyUser:(NSString *)userId
withOptOutList:(NSArray *)optOut;
This will also begin tracking and reporting of a session, and track a daily active user. This functionality is also accessable from the C API:
extern void TeakIdentifyUser(const char* userId,
const char* userConfigurationJson);
This should be how you identify the user in your back-end. |
- identifyUser:withOptOutList:andEmail:
Use identifyUser:withConfiguration: instead |
Tell Teak how to identify the current user, with data collection opt-out.
- (void)identifyUser:(NSString *)userId
withOptOutList:(NSArray *)optOut
andEmail:(NSString *)email;
This will also begin tracking and reporting of a session, and track a daily active user. This functionality is also accessable from the C API:
extern void TeakIdentifyUser(const char* userId,
const char* userConfigurationJson);
This should be how you identify the user in your back-end. |
- identifyUser:withConfiguration:
Tell Teak how to identify the current user, with data collection opt-out.
- (void)identifyUser:(NSString *)userIdentifier
withConfiguration:(TeakUserConfiguration *)userConfiguration;
This will also begin tracking and reporting of a session, and track a daily active user. This functionality is also accessable from the C API:
extern void TeakIdentifyUser(const char* userId,
const char* userConfigurationJson);
This should be how you identify the user in your back-end. |
- refreshPushTokenIfAuthorized
If the user has authorized push notifications, manually refresh the push token.
- (void)refreshPushTokenIfAuthorized;
This is used in conjunction with the TeakDoNotRefreshPushToken
Plist configuration flag. If TeakDoNotRefreshPushToken
is false, or not present, you do not need to call this method.
- trackEventWithActionId:forObjectTypeId:andObjectInstanceId:
Track an arbitrary event in Teak.
- (void)trackEventWithActionId:(NSString *)actionId
forObjectTypeId:(NSString *)objectTypeId
andObjectInstanceId:(NSString *)objectInstanceId;
- incrementEventWithActionId:forObjectTypeId:andObjectInstanceId:count:
Increment an arbitrary event in Teak.
- (void)incrementEventWithActionId:(NSString *)actionId
forObjectTypeId:(NSString *)objectTypeId
andObjectInstanceId:(NSString *)objectInstanceId
count:(int64_t)count;
- notificationState
Push notification authorization state.
- (TeakNotificationState)notificationState;
- canOpenSettingsAppToThisAppsSettings
Can Settings.app be opened to the settings for this application.
- (BOOL)canOpenSettingsAppToThisAppsSettings;
- openSettingsAppToThisAppsSettings
Open Settings.app to the settings for this application.
- (BOOL)openSettingsAppToThisAppsSettings;
- canOpenNotificationSettings
Open can Settings.app be opened to the notification settings for this application.
- (BOOL)canOpenNotificationSettings;
- openNotificationSettings
Open Settings.app to the notification settings for this application.
- (BOOL)openNotificationSettings;
- setApplicationBadgeNumber:
Set the badge number on the icon of the application.
- (void)setApplicationBadgeNumber:(int)count;
- setNumericAttribute:forKey:
Track a numeric player profile attribute.
- (void)setNumericAttribute:(double)value
forKey:(NSString *)key;
This functionality is also accessable from the C API:
extern void TeakSetNumericAttribute(const char* cstr_key,
double value);
- setStringAttribute:forKey:
Track a string player profile attribute.
- (void)setStringAttribute:(NSString *)value
forKey:(NSString *)key;
This functionality is also accessable from the C API:
extern void TeakSetStringAttribute(const char* cstr_key,
const char* cstr_value);
- getDeviceConfiguration
Get Teak’s configuration data about the current device.
- (NSString *)getDeviceConfiguration;
- getAppConfiguration
Get Teak’s configuration data about the current app.
- (NSString *)getAppConfiguration;
- channelCategories
Get the current set of channel opt out categories.
- (NSArray *)channelCategories;
- processDeepLinks
Process deep links.
- (void)processDeepLinks;
Deep links will be processed the sooner of:
-
The user has been identified
-
This method is called
- handleDeepLinkPath:
Manually pass Teak a deep link path to handle.
- (BOOL)handleDeepLinkPath:(NSString *)path;
Return
true if the deep link was found and handled.
This path should be prefixed with a forward slash, and can contain query parameters, e.g.
/foo/bar?fizz=buzz
It should not contain a host, or a scheme.
This function will only execute deep links that have been defined through Teak. It has no visibility into any other SDKs or custom code. |
- setState:forChannel:
Assign the opt-out state to a Teak Marketing Channel.
- (TeakOperation *)setState:(NSString *)state
forChannel:(NSString *)channel;
- setState:forChannel:andCategory:
Assign the opt-out state to a Teak Marketing Category pair.
- (TeakOperation *)setState:(NSString *)state
forChannel:(NSString *)channel
andCategory:(NSString *)category;
Static Methods
+ initForApplicationId:withClass:andApiKey:
Set up Teak in a single function call.
+ (void)initForApplicationId:(NSString *)appId
withClass:(Class)appDelegateClass
andApiKey:(NSString *)apiKey;
This function must be called from no other place than main() in your application’s 'main.m' or 'main.mm' file before UIApplicationMain() is called. Ex:
int main(int argc, char *argv[])
{
@autoreleasepool {
// Add this line here.
[Teak initForApplicationId:@"your_app_id"
withClass:[YourAppDelegate class]
andApiKey:@"your_api_key"];
return UIApplicationMain(argc, argv, nil,
NSStringFromClass([YourAppDelegate class]));
}
}
This functionality is also accessable from the C API:
extern void Teak_Plant(Class appDelegateClass,
NSString* appId,
NSString* appSecret);
+ isTeakNotification:
Returns true if the notification was sent by Teak.
+ (BOOL)isTeakNotification:(UNNotification *)notification;
+ didReceiveNotificationResponse:withCompletionHandler:
If you are setting your own UNNotificationCenter delegate, then you need to call this method from your handler.
+ (BOOL)didReceiveNotificationResponse:(UNNotificationResponse *)response
withCompletionHandler:(void(^)(void))completionHandler;
If this method returns true, do not call the completion handler yourself.
+ willPresentNotification:withCompletionHandler:
If you are setting your own UNNotificationCenter delegate, then you need to call this method from your handler.
+ (BOOL)willPresentNotification:(UNNotification *)notification
withCompletionHandler:(void(^)(UNNotificationPresentationOptions))completionHandler;
If this method returns true, do not call the completion handler yourself.