diff --git a/README.md b/README.md index 31197d6..5a081c6 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ For Unity-specific instructions, please visit https://github.com/tenjin/tenjin-u For any issues or support, please contact: support@tenjin.com -Tenjin iOS SDK (v1.9.1) +Tenjin iOS SDK (v1.12.0) ========= The native iOS SDK for Tenjin. Integrate this into your iOS app or game to get access to the functionality offered at https://www.tenjin.com/. @@ -85,6 +85,49 @@ If you use other services to produce deferred deep links, you can pass Tenjin th You can verify if the integration is working through our Live Test Device Data Tool. Add your `advertising_id` or `IDFA/GAID` to the list of test devices. You can find this under Support -> Test Devices. Go to the SDK Live page and send a test events from your app. You should see live events come in: ![](https://s3.amazonaws.com/tenjin-instructions/sdk_live_open_events.png) +Tenjin initialization with ATTrackingManager and SKAdNetwork: +------------------------------- + +Starting with iOS 14, you will need to call Tenjin `connect()` after the initial ATTrackingManager permissions prompt and selection. If the device accepts tracking permission, the `connect()` method will send the IDFA to our servers. As part of SKAdNetwork, we created wrapper methods for `registerAppForAdNetworkAttribution()` and `updateConversionValue(_:)`. Our methods will register the equivalent SKAdNetwork methods and also send the conversion values on our servers. + +```objectivec + + [TenjinSDK init:@""]; + + // This will call [SKAdNetwork registerAppForAdNetworkAttribution] + // + [TenjinSDK registerAppForAdNetworkAttribution]; + + if (@available(iOS 14, *)) { + NSUInteger status = [ATTrackingManager trackingAuthorizationStatus]; + + if (status == ATTrackingManagerAuthorizationStatusNotDetermined){ + [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) { + [TenjinSDK connect]; + }]; + } + else { + [TenjinSDK connect]; + } + } else { + [TenjinSDK connect]; + } + + // This will send [SKAdNetwork updateConversionValue: 1] and + // also send conversoin value to our servers + // + [TenjinSDK updateSkAdNetworkConversionValue: 1]; + +``` + +If you are running non-SKAdNetwork campaigns, you can also send the equivalent conversion values to our servers. For example: + +```objectivec + + // Send Non-SKAdNetwork conversion value to Tenjin + [TenjinSDK updateConversionValue: 1]; +``` + Tenjin and GDPR: ------- As part of GDPR compliance, with Tenjin's SDK you can opt-in, opt-out devices/users, or select which specific device-related params to opt-in or opt-out. `OptOut()` will not send any API requests to Tenjin and we will not process any events. diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 71ea641..7a81d23 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -208,3 +208,9 @@ v1.11.0 ---- - Send wrapper sdk version prepended to sdk_version +v1.12.0 +---- +- iOS 14 support including SKAdNetwork 2.0 and ATTrackingManager +- Added wrapper methods for SKAdNetwork registerAppForAdNetworkAttribution() and updateConversionValue(_:) +- Upgrade Apple Search Ads Attribution API + diff --git a/TenjinSDK.h b/TenjinSDK.h index 7e18eba..3c9c0fa 100644 --- a/TenjinSDK.h +++ b/TenjinSDK.h @@ -2,6 +2,8 @@ // TenjinSDK.h // TenjinSDK // +// Version 1.12.0 + // Copyright (c) 2016 Tenjin. All rights reserved. // @@ -10,39 +12,78 @@ @interface TenjinSDK : NSObject +#pragma mark Initialization + +- (instancetype)init NS_UNAVAILABLE; + // initialize the Tenjin SDK -+ (TenjinSDK *)init:(NSString *)apiToken; ++ (TenjinSDK *)init:(NSString *)apiToken __deprecated_msg("use `initialize`"); //initialize the Tenjin SDK with shared secret -+ (TenjinSDK *)init:(NSString *)apiToken andSharedSecret:(NSString *)secret; ++ (TenjinSDK *)init:(NSString *)apiToken + andSharedSecret:(NSString *)secret __deprecated_msg("use `initialize`"); //initialize the Tenjin SDK with app subversion -+ (TenjinSDK *)init:(NSString *)apiToken andAppSubversion:(NSNumber *)subversion; ++ (TenjinSDK *)init:(NSString *)apiToken + andAppSubversion:(NSNumber *)subversion __deprecated_msg("use `initialize`"); //initialize the Tenjin SDK with shared secret and app subversion -+ (TenjinSDK *)init:(NSString *)apiToken andSharedSecret:(NSString *)secret andAppSubversion:(NSNumber *)subversion; ++ (TenjinSDK *)init:(NSString *)apiToken + andSharedSecret:(NSString *)secret + andAppSubversion:(NSNumber *)subversion __deprecated_msg("use `initialize`"); + +// initialize the Tenjin SDK ++ (TenjinSDK *)initialize:(NSString *)apiToken; + +//initialize the Tenjin SDK with shared secret ++ (TenjinSDK *)initialize:(NSString *)apiToken + andSharedSecret:(NSString *)secret; + +//initialize the Tenjin SDK with app subversion ++ (TenjinSDK *)initialize:(NSString *)apiToken + andAppSubversion:(NSNumber *)subversion; + +//initialize the Tenjin SDK with shared secret and app subversion ++ (TenjinSDK *)initialize:(NSString *)apiToken + andSharedSecret:(NSString *)secret + andAppSubversion:(NSNumber *)subversion; + +- (id)initWithToken:(NSString *)apiToken + andSharedSecret:(NSString *)secret + andAppSubversion:(NSNumber *)subversion +andDeferredDeeplink:(NSURL *)url + ping:(BOOL)ping NS_DESIGNATED_INITIALIZER; + +#pragma mark Singleton access // initialize the Tenjin SDK + (TenjinSDK *)getInstance:(NSString *)apiToken; //initialize the Tenjin SDK with shared secret -+ (TenjinSDK *)getInstance:(NSString *)apiToken andSharedSecret:(NSString *)secret; ++ (TenjinSDK *)getInstance:(NSString *)apiToken + andSharedSecret:(NSString *)secret; //initialize the Tenjin SDK with app subversion -+ (TenjinSDK *)getInstance:(NSString *)apiToken andAppSubversion:(NSNumber *)subversion; ++ (TenjinSDK *)getInstance:(NSString *)apiToken + andAppSubversion:(NSNumber *)subversion; //initialize the Tenjin SDK with shared secret and app subversion -+ (TenjinSDK *)getInstance:(NSString *)apiToken andSharedSecret:(NSString *)secret andAppSubversion:(NSNumber *)subversion; ++ (TenjinSDK *)getInstance:(NSString *)apiToken + andSharedSecret:(NSString *)secret + andAppSubversion:(NSNumber *)subversion; //initialize the Tenjin SDK + connect + (TenjinSDK *)sharedInstanceWithToken:(NSString *)apiToken __deprecated_msg("use `init` and `connect`"); //initialize the Tenjin SDK + connect with a third party deeplink -+ (TenjinSDK *)sharedInstanceWithToken:(NSString *)apiToken andDeferredDeeplink:(NSURL *)url __deprecated_msg("use `init` and `connectWithDeferredDeeplink`"); ++ (TenjinSDK *)sharedInstanceWithToken:(NSString *)apiToken + andDeferredDeeplink:(NSURL *)url __deprecated_msg("use `init` and `connectWithDeferredDeeplink`"); //returns the shared Tenjin SDK instance + (TenjinSDK *)sharedInstance; +#pragma mark - Functionality + //use connect to send connect call. sharedInstanceWithToken automatically does a connect + (void)connect; @@ -53,25 +94,43 @@ + (void)sendEventWithName:(NSString *)eventName; //This method checks to make sure integers are passed as values. -+ (void)sendEventWithName:(NSString *)eventName andEventValue:(NSString *)eventValue; ++ (void)sendEventWithName:(NSString *)eventName + andEventValue:(NSString *)eventValue; //This method is deprecated in favor of [transaction: andReceipt:], so Tenjin can verify your transactions + (void)transaction:(SKPaymentTransaction *)transaction __attribute__((deprecated)); //Use this method to submit a transaction to Tenjin, we will also attempt to verify it for our records -+ (void)transaction:(SKPaymentTransaction *)transaction andReceipt:(NSData *)receipt; ++ (void)transaction:(SKPaymentTransaction *)transaction + andReceipt:(NSData *)receipt; //use transactionWithProductName... when you don't use Apple's SKPaymentTransaction and need to pass revenue directly -+ (void)transactionWithProductName:(NSString *)productName andCurrencyCode:(NSString *)currencyCode andQuantity:(NSInteger)quantity andUnitPrice:(NSDecimalNumber *)price; ++ (void)transactionWithProductName:(NSString *)productName + andCurrencyCode:(NSString *)currencyCode + andQuantity:(NSInteger)quantity + andUnitPrice:(NSDecimalNumber *)price; //use transactionWithProductName...when you don't use Apple's SKPaymentTransaction and need to pass revenue directly with a NSData binary receipt -+ (void)transactionWithProductName:(NSString *)productName andCurrencyCode:(NSString *)currencyCode andQuantity:(NSInteger)quantity andUnitPrice:(NSDecimalNumber *)price andTransactionId:(NSString *)transactionId andReceipt:(NSData *)receipt; ++ (void)transactionWithProductName:(NSString *)productName + andCurrencyCode:(NSString *)currencyCode + andQuantity:(NSInteger)quantity + andUnitPrice:(NSDecimalNumber *)price + andTransactionId:(NSString *)transactionId + andReceipt:(NSData *)receipt; //use this method when you want to pass in a base64 receipt instead of a NSData receipt -+ (void)transactionWithProductName:(NSString *)productName andCurrencyCode:(NSString *)currencyCode andQuantity:(NSInteger) quantity andUnitPrice:(NSDecimalNumber *)price andTransactionId:(NSString *)transactionId andBase64Receipt:(NSString *)receipt; ++ (void)transactionWithProductName:(NSString *)productName + andCurrencyCode:(NSString *)currencyCode + andQuantity:(NSInteger)quantity + andUnitPrice:(NSDecimalNumber *)price + andTransactionId:(NSString *)transactionId + andBase64Receipt:(NSString *)receipt; //use this method to register the attribution callback -- (void)registerDeepLinkHandler:(void (^)(NSDictionary * params, NSError * error))deeplinkHandler; +- (void)registerDeepLinkHandler:(void (^)(NSDictionary *params, NSError *error))deeplinkHandler; + +//notify Tenjin of a new subscription purchase +- (void)handleSubscriptionPurchase:(SKPaymentTransaction *)transaction; // GDPR opt-out + (void)optOut; @@ -88,4 +147,41 @@ // Appends app subversion to app version + (void)appendAppSubversion:(NSNumber *)subversion; +// SKAdNetwork conversion value ++ (void)updateSkAdNetworkConversionValue:(int)conversionValue; + +// non-SKAdNetwork conversion value ++ (void)updateConversionValue:(int)conversionValue; + +#pragma mark Util + ++ (void)verboseLogs; + ++ (void)debugLogs; + ++ (void)setLogHandler:(void (^)(NSString *))handler; + ++ (NSString *)sdkVersion; + ++ (void)setWrapperVersion:(NSString *)wrapperVersion; + ++ (void)setValue:(NSString *)value + forKey:(NSString *)key; + ++ (void)registerAppForAdNetworkAttribution; +@end +// +// Created by Tenjin on 2019-05-17. +// Copyright (c) 2019 Tenjin. All rights reserved. +// + +#import +#import "TenjinSDK.h" + + +@interface TenjinSDK (MoPubILRD) ++ (void)subscribeMoPubImpressions; + ++ (void)mopubImpressionFromJSON:(NSString *)jsonString; @end + diff --git a/TenjinSDK.podspec b/TenjinSDK.podspec index a8b30c9..7744a08 100644 --- a/TenjinSDK.podspec +++ b/TenjinSDK.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "TenjinSDK" - s.version = "1.10.0" + s.version = "1.12.0" s.summary = "TenjinSDK" s.description = <<-DESC Tenjin is a unique growth infrastructure platform that helps you streamline your mobile marketing. diff --git a/libTenjinSDK.a b/libTenjinSDK.a index 9bd6bff..bd94f26 100644 Binary files a/libTenjinSDK.a and b/libTenjinSDK.a differ diff --git a/libTenjinSDKUniversal.a b/libTenjinSDKUniversal.a index 26dff96..95b1e22 100644 Binary files a/libTenjinSDKUniversal.a and b/libTenjinSDKUniversal.a differ