Skip to content

Commit

Permalink
Merge pull request #57 from tenjin/release_tenjin_5168
Browse files Browse the repository at this point in the history
Add SDK 1.12.0
  • Loading branch information
vanner authored Aug 31, 2020
2 parents 29110e2 + c18257f commit 782a37a
Show file tree
Hide file tree
Showing 6 changed files with 161 additions and 16 deletions.
45 changes: 44 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ For Unity-specific instructions, please visit https://github.com/tenjin/tenjin-u

For any issues or support, please contact: [email protected]

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/.
Expand Down Expand Up @@ -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 <a href="https://www.tenjin.io/dashboard/sdk_diagnostics">Live Test Device Data Tool</a>. Add your `advertising_id` or `IDFA/GAID` to the list of test devices. You can find this under Support -> <a href="https://www.tenjin.io/dashboard/debug_app_users">Test Devices</a>. Go to the <a href="https://www.tenjin.io/dashboard/sdk_diagnostics">SDK Live page</a> 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 <a href="">ATTrackingManager</a> permissions prompt and selection. If the device accepts tracking permission, the `connect()` method will send the IDFA to our servers. As part of <a href="https://developer.apple.com/documentation/storekit/skadnetwork">SKAdNetwork</a>, 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:@"<API_KEY>"];
// 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.
Expand Down
6 changes: 6 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

124 changes: 110 additions & 14 deletions TenjinSDK.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// TenjinSDK.h
// TenjinSDK
//
// Version 1.12.0

// Copyright (c) 2016 Tenjin. All rights reserved.
//

Expand All @@ -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;

Expand All @@ -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;
Expand All @@ -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 <Foundation/Foundation.h>
#import "TenjinSDK.h"


@interface TenjinSDK (MoPubILRD)
+ (void)subscribeMoPubImpressions;

+ (void)mopubImpressionFromJSON:(NSString *)jsonString;
@end

2 changes: 1 addition & 1 deletion TenjinSDK.podspec
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Binary file modified libTenjinSDK.a
Binary file not shown.
Binary file modified libTenjinSDKUniversal.a
Binary file not shown.

0 comments on commit 782a37a

Please sign in to comment.