Skip to content

Commit 534fa7f

Browse files
Merge pull request #96 from AppsFlyerSDK/development
Development
2 parents 56d8e5f + 4a4e8ef commit 534fa7f

File tree

20 files changed

+1109
-40
lines changed

20 files changed

+1109
-40
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This workflow creates new comment from template to an issue
2+
# if it was labled as 'support'
3+
4+
name: Add comment
5+
on:
6+
issues:
7+
types:
8+
- labeled
9+
jobs:
10+
add-comment:
11+
if: github.event.label.name == 'support'
12+
runs-on: ubuntu-latest
13+
permissions:
14+
issues: write
15+
steps:
16+
- name: Add comment
17+
uses: peter-evans/create-or-update-comment@a35cf36e5301d70b76f316e867e7788a55a31dae
18+
with:
19+
issue-number: ${{ github.event.issue.number }}
20+
body: |
21+
👋 Hi @${{ github.event.issue.user.login }} and Thank you for reaching out to us.
22+
In order for us to provide optimal support, please submit a ticket to our support team at [email protected].
23+
When submitting the ticket, please specify:
24+
- ✅ your AppsFlyer sign-up (account) email
25+
- ✅ app ID
26+
- ✅ production steps
27+
- ✅ logs
28+
- ✅ code snippets
29+
- ✅ and any additional relevant information.

.github/workflows/test.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: CI - Tests
2+
on:
3+
push:
4+
branches-ignore:
5+
- 'main'
6+
- 'releases/**'
7+
jobs:
8+
Tests:
9+
runs-on: macos-12
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: maxim-lobanov/setup-xcode@v1
13+
with:
14+
xcode-version: latest-stable
15+
- name: CocoaPod Install
16+
run: pod install
17+
- name: Test
18+
run: xcodebuild test -scheme segment-appsflyer-ios -workspace segment-appsflyer-ios.xcworkspace -destination 'platform=iOS Simulator,name=iPhone 13' | xcpretty && exit ${PIPESTATUS[0]}

Cartfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
binary "https://raw.githubusercontent.com/AppsFlyerSDK/AppsFlyerFramework/master/Carthage/appsflyer-ios.json"
2-
github "segmentio/analytics-ios"
1+
binary "https://raw.githubusercontent.com/AppsFlyerSDK/AppsFlyerFramework/master/Carthage/appsflyer-ios.json" == 6.9.1
2+
github "segmentio/analytics-ios"

Cartfile.resolved

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
binary "https://raw.githubusercontent.com/AppsFlyerSDK/AppsFlyerFramework/master/Carthage/appsflyer-ios.json" "6.8.1"
2-
github "segmentio/analytics-ios" "4.1.6"
1+
binary "https://raw.githubusercontent.com/AppsFlyerSDK/AppsFlyerFramework/master/Carthage/appsflyer-ios.json" "6.9.1"
2+
github "segmentio/analytics-ios" "4.1.8"

Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ let package = Package(
1717
dependencies: [
1818
// Dependencies declare other packages that this package depends on.
1919
.package(name: "Segment", url: "https://github.com/segmentio/analytics-ios.git" , from: "4.0.0"),
20-
.package(name: "AppsFlyerLib" , url: "https://github.com/AppsFlyerSDK/AppsFlyerFramework.git", from: "6.8.1"),
20+
.package(name: "AppsFlyerLib" , url: "https://github.com/AppsFlyerSDK/AppsFlyerFramework.git", .exact("6.9.1")),
2121
],
2222
targets: [
2323
// Targets are the basic building blocks of a package. A target can define a module or a test suite.

Podfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Uncomment the next line to define a global platform for your project
2+
# platform :ios, '9.0'
3+
4+
target 'segment-appsflyer-ios' do
5+
# Comment the next line if you don't want to use dynamic frameworks
6+
use_frameworks!
7+
8+
# Pods for segment-appsflyer-ios
9+
pod 'Analytics'
10+
pod 'AppsFlyerFramework'
11+
12+
end
13+
14+
target 'SegmentAppsFlyeriOSTests' do
15+
# Comment the next line if you don't want to use dynamic frameworks
16+
use_frameworks!
17+
18+
# Pods for SegmentAppsFlyeriOSTests
19+
pod 'OCMock'
20+
21+
end

README.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
# AppsFlyer integration for Segment.
44

5-
## This is a Segment wrapper for AppsFlyer SDK that is built with iOS SDK v6.8.1.
5+
## This is a Segment wrapper for AppsFlyer SDK that is built with iOS SDK v6.9.1.
66

77
[![Version](https://img.shields.io/cocoapods/v/segment-appsflyer-ios.svg?style=flat)](http://cocoapods.org/pods/segment-appsflyer-ios)
88
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
9-
9+
[![CI - Tests](https://github.com/AppsFlyerSDK/segment-appsflyer-ios/actions/workflows/test.yml/badge.svg?branch=dev%2FDELIVRY-17805%2Funit-tests&event=push)](https://github.com/AppsFlyerSDK/segment-appsflyer-ios/actions/workflows/test.yml)
1010

1111
----------
1212
🛠 In order for us to provide optimal support, we would kindly ask you to submit any issues to [email protected]
@@ -48,12 +48,12 @@ To install the segment-appsflyer-ios integration:
4848

4949
**Production** version:
5050
```ruby
51-
pod 'segment-appsflyer-ios', '6.8.1'
51+
pod 'segment-appsflyer-ios', '6.9.1'
5252
```
5353

5454
**Strict mode SDK** version:
5555
```ruby
56-
pod 'segment-appsflyer-ios/Strict', '6.8.1'
56+
pod 'segment-appsflyer-ios/Strict', '6.9.1'
5757
```
5858
Use the strict mode SDK to completely remove IDFA collection functionality and AdSupport framework dependencies (for example, when developing apps for kids).
5959

@@ -65,7 +65,7 @@ Use the strict mode SDK to completely remove IDFA collection functionality and A
6565

6666
**Production** version:
6767
```ogdl
68-
github "AppsFlyerSDK/segment-appsflyer-ios" "6.8.1"
68+
github "AppsFlyerSDK/segment-appsflyer-ios" "6.9.1"
6969
```
7070

7171

@@ -93,7 +93,7 @@ First of all, you must provide values for AppsFlyer Dev Key, Apple App ID (iTune
9393

9494
Open `AppDelegate.h` and add:
9595

96-
```
96+
```objective-c
9797
#import "SEGAppsFlyerIntegrationFactory.h"
9898
```
9999

@@ -104,7 +104,7 @@ In `AppDelegate.m` ➜ `didFinishLaunchingWithOptions`:
104104
// For ApsFlyer debug logs
105105
[AppsFlyerLib shared].isDebug = YES;
106106

107-
[[AppsFlyerLib shared] waitForATTUserAuthorizationWithTimeoutInterval:60];
107+
// [[AppsFlyerLib shared] waitForATTUserAuthorizationWithTimeoutInterval:60];
108108
/*
109109
Based on your needs you can either pass a delegate to process deferred
110110
and direct deeplinking callbacks or disregard them.
@@ -118,14 +118,13 @@ In `AppDelegate.m` ➜ `didFinishLaunchingWithOptions`:
118118
// SEGAppsFlyerIntegrationFactory* factoryWithDelegate = [SEGAppsFlyerIntegrationFactory createWithLaunchDelegate:self andManualMode:YES];
119119

120120

121-
SEGAnalyticsConfiguration *config = [SEGAnalyticsConfiguration configurationWithWriteKey:@"WYsuyFINOKZuQyQAGn5JQoCgIdhOI146"];
121+
SEGAnalyticsConfiguration *config = [SEGAnalyticsConfiguration configurationWithWriteKey:@"SEGMENT_KEY"];
122122
[config use:factoryNoDelegate];
123123
// [config use:factoryWithDelegate]; // use this if you want to get conversion data in the app. Read more in the integration guide
124124
config.enableAdvertisingTracking = YES; //OPTIONAL
125125
config.trackApplicationLifecycleEvents = YES; //OPTIONAL
126126
config.trackDeepLinks = YES; //OPTIONAL
127127
config.trackPushNotifications = YES; //OPTIONAL
128-
config.trackAttributionData = YES; //OPTIONAL
129128
[SEGAnalytics debug:YES]; //OPTIONAL
130129
[SEGAnalytics setupWithConfiguration:config];
131130
```
@@ -156,15 +155,16 @@ In `AppDelegate.m` ➜ `applicationDidBecomeActive`:
156155
3. Open `AppDelegate.swift` and add:
157156

158157
```swift
159-
import Analytics
158+
import Segment
160159
import AppsFlyerLib
160+
import segment_appsflyer_ios
161161
```
162162

163163
4. In `didFinishLaunchingWithOptions` add:
164164
```swift
165165
// For AppsFLyer debug logs uncomment the line below
166166
// AppsFlyerLib.shared().isDebug = true
167-
AppsFlyerLib.shared().waitForATTUserAuthorization(withTimeoutInterval: 60)
167+
// AppsFlyerLib.shared().waitForATTUserAuthorization(withTimeoutInterval: 60)
168168

169169
/*
170170
Based on your needs you can either pass a delegate to process deferred
@@ -188,7 +188,6 @@ import AppsFlyerLib
188188
config.trackApplicationLifecycleEvents = true //OPTIONAL
189189
config.trackDeepLinks = true //OPTIONAL
190190
config.trackPushNotifications = true //OPTIONAL
191-
config.trackAttributionData = true //OPTIONAL
192191

193192
Analytics.debug(false)
194193
Analytics.setup(with: config)
@@ -220,7 +219,7 @@ In identify call ```traits``` dictionary ```setCustomerUserID``` and ```currenc
220219
In order to get Conversion Data you need to:
221220

222221
1. Add `SEGAppsFlyerLibDelegate` protocol to your AppDelegate.h (or other) class
223-
```
222+
```objective-c
224223
#import <UIKit/UIKit.h>
225224
#import "SEGAppsFlyerIntegrationFactory.h"
226225

@@ -229,7 +228,7 @@ In identify call ```traits``` dictionary ```setCustomerUserID``` and ```currenc
229228
2. Pass AppDelegate (or other) class when configuring Segment Analytics with AppsFlyer. Change line `[config use:[SEGAppsFlyerIntegrationFactory instance]];` to `[config use:[SEGAppsFlyerIntegrationFactory createWithLaunchDelegate:self]];`
230229
3. In the class passed to the method above (AppDelegate.m by default) implement methods of the `SEGAppsFlyerLibDelegate` protocol. See sample code below:
231230
232-
```
231+
```objective-c
233232
#import "AppDelegate.h"
234233
235234
@interface AppDelegate ()
@@ -291,7 +290,7 @@ In identify call ```traits``` dictionary ```setCustomerUserID``` and ```currenc
291290
2. Pass AppDelegate (or other) class when configuring Segment Analytics with AppsFlyer. If you use sample code from above, change line `config.use(factoryNoDelegate)` to `config.use(factoryWithDelegate)`
292291
3. Implement methods of the protocol in the class, passed as a delegate. See sample code below where AppDelegate is used for that:
293292

294-
```
293+
```swift
295294
class AppDelegate: UIResponder, UIApplicationDelegate, SEGAppsFlyerLibDelegate {
296295

297296
var window: UIWindow?
@@ -340,13 +339,13 @@ In order to use Unified Deep linking you need to:
340339

341340
1. Add `SEGAppsFlyerDeepLinkDelegate` protocol to your AppDelegate (or other) class
342341
2. Pass AppDelegate (or other) class when configuring Segment Analytics with AppsFlyer. From the sample code above, change factoryWithDelegate to :
343-
```
342+
```swift
344343
let factoryWithDelegate: SEGAppsFlyerIntegrationFactory = SEGAppsFlyerIntegrationFactory.create(withLaunch: self, andDeepLinkDelegate: self)
345344
```
346345

347346
3. Implement methods of the protocol in the class, passed as a delegate. See sample code below where AppDelegate is used for that:
348347

349-
```
348+
```swift
350349
extension AppDelegate: SEGAppsFlyerDeepLinkDelegate {
351350
func didResolveDeepLink(_ result: DeepLinkResult) {
352351
print(result)
@@ -359,7 +358,7 @@ extension AppDelegate: SEGAppsFlyerDeepLinkDelegate {
359358
## <a id="install_attributed"> Install Attributed event
360359

361360
If you are working with networks that don't allow passing user level data to 3rd parties, you will need to apply code to filter out these networks before calling
362-
```
361+
```objective-c
363362
// [self.analytics track:@"Install Attributed" properties:[properties copy]];
364363
```
365364

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
//
2+
// SegmentAppsFlyeriOSTests.swift
3+
// SegmentAppsFlyeriOSTests
4+
//
5+
// Created by Moris Gateno on 27/12/2022.
6+
// Copyright © 2022 Andrii Hahan. All rights reserved.
7+
//
8+
9+
import XCTest
10+
import SegmentAppsFlyeriOS
11+
12+
13+
14+
final class SegmentAppsFlyeriOSTests: XCTestCase , SEGAppsFlyerLibDelegate, SEGAppsFlyerDeepLinkDelegate {
15+
func onConversionDataSuccess(_ conversionInfo: [AnyHashable : Any]) {
16+
print("onConversionDataSuccess")
17+
}
18+
19+
func onConversionDataFail(_ error: Error) {
20+
print("onConversionDataFail")
21+
}
22+
23+
24+
override func setUpWithError() throws {
25+
// Put setup code here. This method is called before the invocation of each test method in the class.
26+
}
27+
28+
override func tearDownWithError() throws {
29+
// Put teardown code here. This method is called after the invocation of each test method in the class.
30+
}
31+
32+
//
33+
//instance
34+
//
35+
func testSEGAppsFlyerIntegrationFactory_instance_happyFlow() throws {
36+
let factoryObject = SEGAppsFlyerIntegrationFactory.instance()
37+
XCTAssertNil(factoryObject?.delegate)
38+
XCTAssertNil(factoryObject?.dlDelegate)
39+
XCTAssertEqual(factoryObject?.manualMode,false)
40+
}
41+
42+
//
43+
//createWithLaunchDelegate
44+
//
45+
func testSEGAppsFlyerIntegrationFactory_createWithLaunchDelegate_happyFlow() throws {
46+
let factoryObject = SEGAppsFlyerIntegrationFactory.create(withLaunch:self)
47+
XCTAssertNotNil(factoryObject?.delegate)
48+
XCTAssertTrue(((factoryObject?.delegate.isEqual(self)) != nil))
49+
XCTAssertNil(factoryObject?.dlDelegate)
50+
XCTAssertEqual(factoryObject?.manualMode,false)
51+
}
52+
53+
func testSEGAppsFlyerIntegrationFactory_createWithLaunchDelegate_nilFlow() throws {
54+
let factoryObject = SEGAppsFlyerIntegrationFactory.create(withLaunch:nil)
55+
XCTAssertNil(factoryObject?.delegate)
56+
}
57+
58+
//
59+
//createWithLaunchDelegate andDeepLinkDelegate
60+
//
61+
62+
func testSEGAppsFlyerIntegrationFactory_createWithLaunchDelegateandDeepLinkDelegate_happyFlow() throws {
63+
let factoryObject = SEGAppsFlyerIntegrationFactory.create(withLaunch: self, andDeepLinkDelegate: self)
64+
XCTAssertNotNil(factoryObject?.delegate)
65+
XCTAssertNotNil(factoryObject?.dlDelegate)
66+
XCTAssertTrue(((factoryObject?.delegate.isEqual(self)) != nil))
67+
XCTAssertTrue(((factoryObject?.dlDelegate.isEqual(self)) != nil))
68+
XCTAssertEqual(factoryObject?.manualMode,false)
69+
}
70+
71+
func testSEGAppsFlyerIntegrationFactory_createWithLaunchDelegateandDeepLinkDelegate_nilFlow() throws {
72+
let factoryObject = SEGAppsFlyerIntegrationFactory.create(withLaunch: nil, andDeepLinkDelegate: nil)
73+
XCTAssertNil(factoryObject?.delegate)
74+
XCTAssertNil(factoryObject?.dlDelegate)
75+
}
76+
77+
//
78+
//createWithLaunchDelegate andManualMode
79+
//
80+
81+
func testSEGAppsFlyerIntegrationFactory_createWithLaunchDelegateandManualMode_happyFlow() throws {
82+
var factoryObject = SEGAppsFlyerIntegrationFactory.create(withLaunch: self, andManualMode: true)
83+
XCTAssertNotNil(factoryObject?.delegate)
84+
XCTAssertNil(factoryObject?.dlDelegate)
85+
XCTAssertTrue(((factoryObject?.delegate.isEqual(self)) != nil))
86+
XCTAssertEqual(factoryObject?.manualMode,true)
87+
factoryObject = SEGAppsFlyerIntegrationFactory.create(withLaunch: self, andManualMode: false)
88+
XCTAssertEqual(factoryObject?.manualMode,false)
89+
}
90+
91+
//
92+
//createWithLaunchDelegate andDeepLinkDelegate andManualMode
93+
//
94+
func testSEGAppsFlyerIntegrationFactory_createWithLaunchDelegateandDeepLinkDelegateandManualMode_happyFlow() throws {
95+
let factoryObject = SEGAppsFlyerIntegrationFactory.create(withLaunch: self, andDeepLinkDelegate: self, andManualMode: true)
96+
XCTAssertNotNil(factoryObject?.delegate)
97+
XCTAssertNotNil(factoryObject?.dlDelegate)
98+
XCTAssertTrue(((factoryObject?.delegate.isEqual(self)) != nil))
99+
XCTAssertTrue(((factoryObject?.dlDelegate.isEqual(self)) != nil))
100+
XCTAssertEqual(factoryObject?.manualMode,true)
101+
}
102+
103+
//
104+
//createWithSettings
105+
//
106+
func testSEGAppsFlyerIntegrationFactory_createWithSettings_happyFlow() throws {
107+
let factoryObject = SEGAppsFlyerIntegrationFactory.create(withLaunch: self, andDeepLinkDelegate: self, andManualMode: true)
108+
let integrationObject : SEGAppsFlyerIntegration = factoryObject?.create(withSettings: Dictionary(), for: Analytics()) as! SEGAppsFlyerIntegration
109+
XCTAssertNotNil(integrationObject)
110+
XCTAssertTrue(integrationObject.manualMode==true)
111+
XCTAssertTrue(integrationObject.segDelegate.isEqual(self))
112+
XCTAssertTrue(integrationObject.segDLDelegate.isEqual(self))
113+
}
114+
115+
func testPerformanceExample() throws {
116+
// This is an example of a performance test case.
117+
measure {
118+
// Put the code you want to measure the time of here.
119+
}
120+
}
121+
122+
}

0 commit comments

Comments
 (0)