Skip to content

Commit

Permalink
4.13.1
Browse files Browse the repository at this point in the history
  • Loading branch information
unity-thull committed Apr 23, 2021
1 parent 11d9e3b commit b9bc1ea
Show file tree
Hide file tree
Showing 13 changed files with 51 additions and 16 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## [4.13.1](https://github.com/deltaDNA/ios-sdk/releases/tag/4.13.1) (2021-04-23)
### New
- Signal purchase methods now generate verifiable transaction events

## [4.13.0](https://github.com/deltaDNA/ios-sdk/releases/tag/4.13.0) (2021-03-11)
### New
- An .xcframework is now provided with frameworks for supported platforms
Expand Down
6 changes: 3 additions & 3 deletions DeltaDNA.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Pod::Spec.new do |spec|

# Spec Metadata
spec.name = "DeltaDNA"
spec.version = "4.13.0"
spec.version = "4.13.1"
spec.summary = "A gaming analytics platform."

spec.homepage = "https://deltadna.com"
Expand All @@ -15,10 +15,10 @@ Pod::Spec.new do |spec|

# Platform Specifics
spec.ios.deployment_target = "10.0"
spec.tvos.deployment_target = "9.2"
spec.platform = :ios

# Source Location
spec.source = { :http => "https://github.com/deltaDNA/ios-sdk/releases/download/4.13.0/DeltaDNA-iOS.tar.gz" }
spec.source = { :http => "https://github.com/deltaDNA/ios-sdk/releases/download/4.13.1/DeltaDNA-4.13.1.zip" }

# Source Code
spec.vendored_frameworks = 'build/Frameworks/DeltaDNA.xcframework'
Expand Down
4 changes: 3 additions & 1 deletion DeltaDNA/DDNAPinpointer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,13 @@ public class DDNAPinpointer: NSObject {

@objc public func createSignalTrackingPurchaseEvent(
realCurrencyAmount: NSNumber,
realCurrencyType: NSString
realCurrencyType: NSString,
transactionID: NSString
) -> DDNAEvent {
let signalEvent = createBaseSignalMappingEvent(eventName: "unitySignalPurchase")
signalEvent.setParam(realCurrencyAmount, forKey: "realCurrencyAmount")
signalEvent.setParam(realCurrencyType, forKey: "realCurrencyType")
signalEvent.setParam(transactionID, forKey: "transactionID")
return signalEvent
}

Expand Down
5 changes: 3 additions & 2 deletions DeltaDNA/DDNASDK.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,10 @@ The Apple Device Token received from in your AppDelegate
@availability iOS 12 or higher
@param realCurrencyAmount The amount spent on the purchase, in the currency used for the purchase
@param realCurrencyType The currency code of the currency used for the purchase. For example, USD for dollars or GBP for pounds sterling.
@param transactionID The transaction ID of the purchase, as reported by Apple's StoreKit API
@param transactionReceipt The base64 encoded receipt data, as returned by Apple's StoreKit validation API
*/
- (void) recordSignalTrackingPurchaseEventWithRealCurrencyAmount :(NSNumber *)realCurrencyAmount realCurrencyType:(NSString *)realCurrencyType;

- (void) recordSignalTrackingPurchaseEventWithRealCurrencyAmount :(NSNumber *)realCurrencyAmount realCurrencyType:(NSString *)realCurrencyType transactionID:(NSString *)transactionID transactionReceipt:(NSString *)transactionReceipt;

@end

Expand Down
17 changes: 15 additions & 2 deletions DeltaDNA/DDNASDK.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#import "DDNATrackingSdk.h"
#import "DDNANonTrackingSdk.h"
#import "DDNAInstanceFactory.h"
#import "DDNATransaction.h"

#import <UIKit/UIKit.h>
#import <DeltaDNA/DeltaDNA-Swift.h>
Expand Down Expand Up @@ -244,16 +245,28 @@ - (void) recordSignalTrackingInstallEvent
}
}

- (void) recordSignalTrackingPurchaseEventWithRealCurrencyAmount :(NSNumber *)realCurrencyAmount realCurrencyType:(NSString *)realCurrencyType
- (void) recordSignalTrackingPurchaseEventWithRealCurrencyAmount
:(NSNumber *)realCurrencyAmount
realCurrencyType:(NSString *)realCurrencyType
transactionID:(NSString *)transactionID
transactionReceipt:(NSString *)transactionReceipt
{
if (@available(iOS 12.0, *)) {
if ([_appStoreId length] == 0 || [_appleDeveloperId length] == 0) {
// Check for existance of required fields. Note that in Objective-C, null is equivalent to 0 length.
DDNALogWarn(@"Pinpointer events require an app store ID and an Apple developer ID to be registered in the SDK, no event will be sent");
return;
}
DDNAEvent *event = [DDNAPinpointer.shared createSignalTrackingPurchaseEventWithRealCurrencyAmount:realCurrencyAmount realCurrencyType:realCurrencyType];
DDNAEvent *event = [DDNAPinpointer.shared createSignalTrackingPurchaseEventWithRealCurrencyAmount:realCurrencyAmount realCurrencyType:realCurrencyType transactionID:transactionID];
[self recordEvent:event];

if ([DDNASDK sharedInstance].settings.automaticallyGenerateTransactionForAudiencePinpointer) {
DDNAProduct *placeholderProduct = [DDNAProduct product];
DDNATransaction *transactionEvent = [DDNATransaction transactionWithName:@"Pinpointer Signal Transaction" type:@"PURCHASE" productsReceived:placeholderProduct productsSpent:placeholderProduct];
[transactionEvent setReceipt:transactionReceipt];
[transactionEvent setTransactionId:transactionID];
[self recordEvent:transactionEvent];
}
} else {
DDNALogWarn(@"Audience pinpointer is not supported on iOS versions older than 12");
}
Expand Down
8 changes: 8 additions & 0 deletions DeltaDNA/DDNASettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ extern NSUInteger const DDNA_MAX_EVENT_STORE_BYTES;
*/
@property (nonatomic, assign) BOOL multipleActionsForEventTriggerEnabled;

/**
Controls whether the user or the SDK provides transaction events for the Audience Pinpointer signal events.
A value of true means the SDK will automatically generate a basic transaction event for each unitySignalPurchase.
A value of false means this will be provided by the game.
Defaults to true.
*/
@property (nonatomic, assign) BOOL automaticallyGenerateTransactionForAudiencePinpointer;

/**
Returns the path to the privates settings directory on
this device.
Expand Down
4 changes: 3 additions & 1 deletion DeltaDNA/DDNASettings.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#import "DDNASettings.h"

NSString *const DDNA_SDK_VERSION = @"iOS SDK v4.13.0";
NSString *const DDNA_SDK_VERSION = @"iOS SDK v4.13.1";
NSString *const DDNA_ENGAGE_API_VERSION = @"4";

NSString *const DDNA_EVENT_STORAGE_PATH = @"{persistent_path}";
Expand Down Expand Up @@ -64,6 +64,8 @@ - (id) init

defaultImageMessageHandler = nil;
defaultGameParamtersHandler = nil;

self.automaticallyGenerateTransactionForAudiencePinpointer = true;
}
return self;
}
Expand Down
2 changes: 1 addition & 1 deletion DeltaDNA/DeltaDNA-Swift.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly, strong) DDNAPinpoint
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
- (DDNAEvent * _Nonnull)createSignalTrackingSessionEvent SWIFT_WARN_UNUSED_RESULT;
- (DDNAEvent * _Nonnull)createSignalTrackingInstallEvent SWIFT_WARN_UNUSED_RESULT;
- (DDNAEvent * _Nonnull)createSignalTrackingPurchaseEventWithRealCurrencyAmount:(NSNumber * _Nonnull)realCurrencyAmount realCurrencyType:(NSString * _Nonnull)realCurrencyType SWIFT_WARN_UNUSED_RESULT;
- (DDNAEvent * _Nonnull)createSignalTrackingPurchaseEventWithRealCurrencyAmount:(NSNumber * _Nonnull)realCurrencyAmount realCurrencyType:(NSString * _Nonnull)realCurrencyType transactionID:(NSString * _Nonnull)transactionID SWIFT_WARN_UNUSED_RESULT;
@end

#if __has_attribute(external_source_symbol)
Expand Down
2 changes: 1 addition & 1 deletion Example/iOS Example/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ - (IBAction)setCrossGameUserId:(id)sender {
- (IBAction)sendPinpointerEvents:(id)sender {
[[DDNASDK sharedInstance] recordSignalTrackingSessionEvent];
[[DDNASDK sharedInstance] recordSignalTrackingInstallEvent];
[[DDNASDK sharedInstance] recordSignalTrackingPurchaseEventWithRealCurrencyAmount :@100 realCurrencyType:@"GBP"];
[[DDNASDK sharedInstance] recordSignalTrackingPurchaseEventWithRealCurrencyAmount :@100 realCurrencyType:@"GBP" transactionID:@"mySuperAwesomeTransactionID" transactionReceipt:@"someReceiptData"];
NSLog(@"Uploaded Pinpointer Signal Events");
}

Expand Down
4 changes: 3 additions & 1 deletion README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ target 'MyApp' do
# 如果你使用Swift或者想要使用动态框架,请取消此行注释
use_frameworks!

pod 'DeltaDNA', '~> 4.13.0'
pod 'DeltaDNA', '~> 4.13.1'

target 'MyAppTests' do
inherit! :search_paths
Expand Down Expand Up @@ -141,3 +141,5 @@ DDNAEngagement *engagement = [DDNAEngagement engagementWithDecisionPoint:@"image
## 授权

该资源适用于Apache 2.0授权。

By integrating, accessing, or using the deltaDNA UA SDK, you acknowledge and agree that (1) your access to and use of the deltaDNA UA SDK is governed by Unity’s Monetization Terms of Service, available [here](https://unity3d.com/legal/monetization-services-terms-of-service), and that such service is an Experimental Service (as defined therein); and (2) you will not access or use the deltaDNA UA SDK in connection with any application that is “directed to children” under the age of 13 or would otherwise be subject to the Children’s Online Privacy Protection Act of 1998, or with any application designated as a “Kids” or “Family” application in the Apple App Store or Google Play Store.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

## deltaDNA Analytics iOS SDK

[![Build Status](https://travis-ci.org/deltaDNA/ios-sdk.svg?branch=master)](https://travis-ci.org/deltaDNA/ios-sdk)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)

### Installation
Expand Down Expand Up @@ -37,7 +36,7 @@ target 'MyApp' do
# Uncomment this line if you're using Swift or would like to use dynamic frameworks
use_frameworks!

pod 'DeltaDNA', '~> 4.13.0'
pod 'DeltaDNA', '~> 4.13.1'

target 'MyAppTests' do
inherit! :search_paths
Expand Down Expand Up @@ -288,6 +287,8 @@ Refer to our [documentation](http://docs.deltadna.com/advanced-integration/ios-s

The sources are available under the Apache 2.0 license.

By integrating, accessing, or using the deltaDNA UA SDK, you acknowledge and agree that (1) your access to and use of the deltaDNA UA SDK is governed by Unity’s Monetization Terms of Service, available [here](https://unity3d.com/legal/monetization-services-terms-of-service), and that such service is an Experimental Service (as defined therein); and (2) you will not access or use the deltaDNA UA SDK in connection with any application that is “directed to children” under the age of 13 or would otherwise be subject to the Children’s Online Privacy Protection Act of 1998, or with any application designated as a “Kids” or “Family” application in the Apple App Store or Google Play Store.

## Contact Us

For more information, please visit [deltadna.com](https://deltadna.com/). For questions or assistance, please email us at [[email protected]](mailto:[email protected]).
Expand Down
4 changes: 3 additions & 1 deletion buildFrameworks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ xcodebuild archive -workspace "DeltaDNA.xcworkspace" -scheme "DeltaDNA iOS" -sdk
xcodebuild -create-xcframework -framework archives/ios_devices.xcarchive/Products/Library/Frameworks/DeltaDNA.framework -framework archives/ios_simulators.xcarchive/Products/Library/Frameworks/DeltaDNA.framework -output build/Frameworks/DeltaDNA.xcframework

# Compress the archive ready for distribution to GitHub
tar -zcvf build/DeltaDNA-iOS.tar.gz build/Frameworks
rm build/*.zip
zip -r DeltaDNA-4.13.1.zip build
mv DeltaDNA-4.13.1.zip build/
2 changes: 1 addition & 1 deletion update-version
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ elif [ -z "$2" ]; then
exit 1
fi

sed -i '' "s/$1/$2/g" DeltaDNA/DDNASettings.m DeltaDNA.podspec README.md README-CN.md
sed -i '' "s/$1/$2/g" DeltaDNA/DDNASettings.m DeltaDNA.podspec README.md README-CN.md buildFrameworks.sh .yamato/build.yaml

echo "Have you updated the changelog?"

0 comments on commit b9bc1ea

Please sign in to comment.