Skip to content

Commit 62f2cac

Browse files
authored
Merge pull request #199 from AppsFlyerSDK/RD-76942/updateTo6.5.2Beta
Rd 76942/update to6.5.2 beta
2 parents 71b37ae + 2545c5d commit 62f2cac

File tree

12 files changed

+67
-27
lines changed

12 files changed

+67
-27
lines changed

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,15 +159,12 @@ appsflyerSdk.initSdk(
159159

160160
2. Add the ATT pop-up for IDFA collection so your `AppDelegate.m` will look like this:
161161
```
162-
-(BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
163-
{
164-
[GeneratedPluginRegistrant registerWithRegistry:self];
162+
- (void)applicationDidBecomeActive:(nonnull UIApplication *)application {
165163
if (@available(iOS 14, *)) {
166164
[ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
167-
//If you want to do something with the pop-up
165+
// native code here
168166
}];
169167
}
170-
return [super application:application didFinishLaunchingWithOptions:launchOptions];
171168
}
172169
```
173170

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ android {
3535
dependencies {
3636
implementation fileTree(dir: 'libs', include: ['*.jar'])
3737
implementation 'androidx.appcompat:appcompat:1.0.0'
38-
implementation 'com.appsflyer:af-android-sdk:6.4.3'
38+
implementation 'com.appsflyer:af-android-sdk:6.5.2'
3939
implementation 'com.android.installreferrer:installreferrer:2.1'
4040
}

android/src/main/java/com/appsflyer/appsflyersdk/AppsflyerSdkPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ private void setSharingFilterForPartners(MethodCall call, Result result) {
313313
}
314314

315315
private void setDisableAdvertisingIdentifiers(MethodCall call, Result result) {
316-
isSetDisableAdvertisingIdentifiersEnable = (boolean) call.argument("isSetDisableAdvertisingIdentifiersEnable");
316+
isSetDisableAdvertisingIdentifiersEnable = (boolean) call.arguments;
317317
if (isSetDisableAdvertisingIdentifiersEnable) {
318318
AppsFlyerLib.getInstance().setDisableAdvertisingIdentifiers(true);
319319
} else {

doc/API.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
- [setCurrentDeviceLanguage](#setCurrentDeviceLanguage)
4040
- [setSharingFilterForPartners](#setSharingFilterForPartners)
4141
- [setOneLinkCustomDomain](#setOneLinkCustomDomain)
42+
- [setDisableAdvertisingIdentifiers](#setDisableAdvertisingIdentifiers)
43+
4244
---
4345

4446
##### <a id="appsflyer-options"> **`AppsflyerSdk(Map options)`**
@@ -516,4 +518,13 @@ _Example:_
516518
```dart
517519
appsFlyerSdk.setOneLinkCustomDomain(["promotion.greatapp.com","click.greatapp.com","deals.greatapp.com"]);
518520
```
521+
---
522+
**<a id="setDisableAdvertisingIdentifiers"> `void setDisableAdvertisingIdentifiers(bool isSetDisableAdvertisingIdentifiersEnable)`**
523+
524+
Manually enable or disable Advertiser ID in Android & IDFA in iOS
525+
526+
_Example:_
527+
```dart
528+
widget.appsFlyerSdk.setDisableAdvertisingIdentifiers(true);
529+
```
519530
---

doc/Guides.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -435,19 +435,15 @@ Or
435435

436436
- Add the ATT pop-up for IDFA collection so your `AppDelegate.m` will look like this:
437437

438-
439-
```
440-
-(BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
441-
{
442-
[GeneratedPluginRegistrant registerWithRegistry:self];
443-
if (@available(iOS 14, *)) {
444-
[ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
445-
//If you want to do something with the pop-up
446-
}];
447-
}
448-
return [super application:application didFinishLaunchingWithOptions:launchOptions];
449-
}
450-
```
438+
```
439+
- (void)applicationDidBecomeActive:(nonnull UIApplication *)application {
440+
if (@available(iOS 14, *)) {
441+
[ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
442+
// native code here
443+
}];
444+
}
445+
}
446+
```
451447
452448
453449

example/android/.project

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,15 @@
1414
<natures>
1515
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
1616
</natures>
17+
<filteredResources>
18+
<filter>
19+
<id>1643725221956</id>
20+
<name></name>
21+
<type>30</type>
22+
<matcher>
23+
<id>org.eclipse.core.resources.regexFilterMatcher</id>
24+
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
25+
</matcher>
26+
</filter>
27+
</filteredResources>
1728
</projectDescription>

example/android/app/.project

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,15 @@
2020
<nature>org.eclipse.jdt.core.javanature</nature>
2121
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
2222
</natures>
23+
<filteredResources>
24+
<filter>
25+
<id>1643725221965</id>
26+
<name></name>
27+
<type>30</type>
28+
<matcher>
29+
<id>org.eclipse.core.resources.regexFilterMatcher</id>
30+
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
31+
</matcher>
32+
</filter>
33+
</filteredResources>
2334
</projectDescription>

example/ios/Runner/AppDelegate.m

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@ @implementation AppDelegate
77

88
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
99
[GeneratedPluginRegistrant registerWithRegistry:self];
10-
if (@available(iOS 14, *)) {
10+
return [super application:application didFinishLaunchingWithOptions:launchOptions];
11+
}
12+
13+
- (void)applicationDidBecomeActive:(nonnull UIApplication *)application {
14+
if (@available(iOS 14, *)) {
1115
[ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
12-
//If you want to do something with the pop-up
16+
// native code here
1317
}];
1418
}
15-
return [super application:application didFinishLaunchingWithOptions:launchOptions];
1619
}
1720

1821
// Reports app open from a Universal Link for iOS 9 or above

example/lib/main_page.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class MainPageState extends State<MainPage> {
2424
afDevKey: DotEnv().env["DEV_KEY"],
2525
appId: DotEnv().env["APP_ID"],
2626
showDebug: true,
27-
disableAdvertisingIdentifier: true
27+
timeToWaitForATTUserAuthorization: 15
2828
);
2929
_appsflyerSdk = AppsflyerSdk(options);
3030
_appsflyerSdk.onAppOpenAttribution((res) {
@@ -60,6 +60,7 @@ class MainPageState extends State<MainPage> {
6060
_deepLinkData = dp.toJson();
6161
});
6262
});
63+
6364
}
6465

6566
@override
@@ -100,7 +101,6 @@ class MainPageState extends State<MainPage> {
100101
}
101102

102103
Future<bool> logEvent(String eventName, Map eventValues) {
103-
_appsflyerSdk.disableSKAdNetwork(false);
104104
return _appsflyerSdk.logEvent(eventName, eventValues);
105105
}
106106

ios/Classes/AppsflyerSdkPlugin.m

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,23 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
131131
[self setCurrentDeviceLanguage:call result:result];
132132
}else if([@"setSharingFilterForPartners" isEqualToString:call.method]){
133133
[self setSharingFilterForPartners:call result:result];
134+
}else if([@"setDisableAdvertisingIdentifiers" isEqualToString:call.method]){
135+
[self setDisableAdvertisingIdentifiers:call result:result];
134136
}
135137
else{
136138
result(FlutterMethodNotImplemented);
137139
}
138140
}
139141

142+
- (void)setDisableAdvertisingIdentifiers:(FlutterMethodCall*)call result:(FlutterResult)result{
143+
id isAdvertiserIdEnabled = call.arguments;
144+
if ([isAdvertiserIdEnabled isKindOfClass:[NSNumber class]]) {
145+
BOOL _isAdvertiserIdEnabled = [isAdvertiserIdEnabled boolValue];
146+
[[AppsFlyerLib shared] setDisableAdvertisingIdentifier: _isAdvertiserIdEnabled];
147+
}
148+
result(nil);
149+
}
150+
140151
- (void)setSharingFilterForPartners:(FlutterMethodCall*)call result:(FlutterResult)result{
141152
NSArray* partners = call.arguments;
142153
[[AppsFlyerLib shared] setSharingFilterForPartners: partners];

0 commit comments

Comments
 (0)