Skip to content

Commit

Permalink
6.2.42
Browse files Browse the repository at this point in the history
6.2.42
  • Loading branch information
amit-kremer93 authored Mar 22, 2021
2 parents ed514a6 + 5f5a438 commit 4e1ece0
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 2 deletions.
6 changes: 6 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Release Notes
### 6.2.42
Release date: *2021-March-22*

**Overview and Highlights:**
- Cordova > SKAD Rules fix

### 6.2.41
Release date: *2021-March-16*

Expand Down
17 changes: 17 additions & 0 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ The list of available methods for this plugin is described below.
| [`setHost`](#setHost) | `(String hostPrefix, String hostName)` | Set custom host prefix and host name |
| [`addPushNotificationDeepLinkPath`](#addPushNotificationDeepLinkPath) | `(path)` | configure push notification deep link resolution |
| [`setResolveDeepLinkURLs`](#setResolveDeepLinkURLs) | `(urls)` | get the OneLink from click domains |
| [`disableSKAD`](#disableSKAD) | `(boolean disableSkad)` | disable or enable SKAD |


---
Expand Down Expand Up @@ -628,6 +629,22 @@ window.plugins.appsFlyer.setResolveDeepLinkURLs(urls);
| ----------- |-----------------------------|--------------|
| `urls` | `String[]` | strings array of domains |

---

##### <a id="disableSKAD"> **`disableSKAD(disableSkad): void`**
enable or disable SKAD support. set True if you want to disable it!<br>
`disableSKAD` must be called before calling `initSDK` and for iOS ONLY!.

*Example:*

```javascript
appsFlyer.disableSKAD(true);
```

| parameter | type | description |
| ----------- |-----------------------------|--------------|
| `disableSkad` | `boolean` | disable or enable SKAD support |

---
### <a id="deep-linking-tracking"> Deep linking Tracking

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cordova-plugin-appsflyer-sdk",
"version": "6.2.41",
"version": "6.2.42",
"description": "Cordova AppsFlyer SDK Plugin",
"cordova": {
"id": "cordova-plugin-appsflyer-sdk",
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="cordova-plugin-appsflyer-sdk"
version="6.2.41">
version="6.2.42">
<name>AppsFlyer</name>
<description>Cordova Plugin AppsFlyer</description>
<license>Apache 2.0</license>
Expand Down
2 changes: 2 additions & 0 deletions src/ios/AppsFlyerPlugin.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#import <Foundation/Foundation.h>
#import <Cordova/CDVPlugin.h>
#import "AppsFlyerAttribution.h"
#import <objc/message.h>
typedef void (*bypassDidFinishLaunchingWithOption)(id, SEL, NSInteger);

@interface AppsFlyerPlugin : CDVPlugin <UIApplicationDelegate, AppsFlyerLibDelegate, AppsFlyerDeepLinkDelegate>
// @interface AppsFlyerPlugin : CDVPlugin <UIApplicationDelegate, AppsFlyerTrackerDelegate>
Expand Down
27 changes: 27 additions & 0 deletions src/ios/AppsFlyerPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ - (void)initSdk:(CDVInvokedUrlCommand*)command
[AppsFlyerLib shared].appsFlyerDevKey = devKey;
[AppsFlyerLib shared].isDebug = isDebug;
[AppsFlyerLib shared].useUninstallSandbox = useUninstallSandbox;
// Load SKAD rules
SEL SKSel = NSSelectorFromString(@"__willResolveSKRules:");
id AppsFlyer = [AppsFlyerLib shared];
if ([AppsFlyer respondsToSelector:SKSel]) {
bypassDidFinishLaunchingWithOption msgSend = (bypassDidFinishLaunchingWithOption)objc_msgSend;
msgSend(AppsFlyer, SKSel, 2);
}

#ifndef AFSDK_NO_IDFA
//Here we set the time that the sdk will wait before he starts the launch. we take the time from the 'option' object in the app's index.js
Expand Down Expand Up @@ -804,6 +811,26 @@ - (void)setResolveDeepLinkURLs:(CDVInvokedUrlCommand*)command {
NSLog(@"[DEBUG] AppsFlyer: %@", urls);
}

- (void)disableSKAD:(CDVInvokedUrlCommand *)command
{
if ([command.arguments count] == 0) {
return;
}

BOOL isDisValueBool = NO;
id isDisValue = nil;
isDisValue = [command.arguments objectAtIndex:0];
if ([isDisValue isKindOfClass:[NSNumber class]]) {
isDisValueBool = [(NSNumber*)isDisValue boolValue];
[AppsFlyerLib shared].disableSKAdNetwork = isDisValueBool;
if (isDisValueBool){
NSLog(@"[DEBUG] AppsFlyer: SKADNetwork is disabled");
}else{
NSLog(@"[DEBUG] AppsFlyer: SKADNetwork is enabled");
}
}
}

@end


Expand Down
8 changes: 8 additions & 0 deletions www/appsflyer.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,14 @@ if (!window.CustomEvent) {
exec(null, null, 'AppsFlyerPlugin', 'setResolveDeepLinkURLs', [urls]);
};

/**
* enable or disable SKAD support. set True if you want to disable it!
* @param isDisabled
*/
AppsFlyer.prototype.disableSKAD = function (isDisabled) {
exec(null, null, 'AppsFlyerPlugin', 'disableSKAD', [isDisabled]);
};


module.exports = new AppsFlyer();
})(window);

0 comments on commit 4e1ece0

Please sign in to comment.