Skip to content

Commit

Permalink
No-IDFA sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
amit-kremer93 committed Nov 11, 2020
1 parent fcb1fe9 commit 4e55ef1
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 78 deletions.
1 change: 0 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ declare module "react-native-appsflyer" {
/**
* For iOS Only
* */
disableAdvertisingIdentifier(shouldDisable: boolean): void
disableCollectASA(shouldDisable: boolean): void
setUseReceiptValidationSandbox(isSandbox: boolean): void

Expand Down
9 changes: 0 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,15 +458,6 @@ appsFlyer.setSharingFilter = (partners, successC, errorC) => {
return RNAppsFlyer.setSharingFilter(partners, successC, errorC);
}

/**
* Disables IDFA collecting
* @param shouldDisable Flag to disable/enable IDFA collection
* @platform iOS only
*/
appsFlyer.disableAdvertisingIdentifier = (shouldDisable) => {
return RNAppsFlyer.disableAdvertisingIdentifier(shouldDisable);
}

/**
* Disables Apple Search Ads collecting
* @param shouldDisable Flag to disable/enable Apple Search Ads data collection
Expand Down
102 changes: 44 additions & 58 deletions ios/AppsFlyerLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,17 +186,17 @@ typedef enum {
(including in-app purchases, game levels, etc.)
to evaluate ROI and user engagement.
The iOS SDK is compatible with all iOS/tvOS devices with iOS version 7 and above.
@see [SDK Integration Validator](https://support.appsflyer.com/hc/en-us/articles/207032066-AppsFlyer-SDK-Integration-iOS)
for more information.
*/
@interface AppsFlyerLib : NSObject

/**
Gets the singleton instance of the AppsFlyerLib class, creating it if
necessary.
@return The singleton instance of AppsFlyerLib.
*/
+ (AppsFlyerLib *)shared;
Expand All @@ -209,7 +209,7 @@ typedef enum {

/**
In case you use custom data and you want to receive it in the raw reports.
@see [Setting additional custom data](https://support.appsflyer.com/hc/en-us/articles/207032066-AppsFlyer-SDK-Integration-iOS#setting-additional-custom-data) for more information.
*/
@property(nonatomic, strong, nullable, setter = setAdditionalData:) NSDictionary * customData;
Expand All @@ -224,34 +224,20 @@ typedef enum {
*/
@property(nonatomic, strong) NSString * appleAppID;

/**
AppsFlyer SDK collect Apple's `advertisingIdentifier` if the `AdSupport.framework` included in the SDK.
You can disable this behavior by setting the following property to YES
*/
@property(nonatomic) BOOL disableAdvertisingIdentifier;

@property(nonatomic, strong, readonly) NSString *advertisingIdentifier;

/**
Waits for request user authorization to access app-related data
*/
- (void)waitForATTUserAuthorizationWithTimeoutInterval:(NSTimeInterval)timeoutInterval
NS_SWIFT_NAME(waitForATTUserAuthorization(timeoutInterval:));

@property(nonatomic) BOOL disableSKAdNetwork;

/**
In case of in app purchase events, you can set the currency code your user has purchased with.
The currency code is a 3 letter code according to ISO standards
Objective-C:
<pre>
[[AppsFlyerLib shared] setCurrencyCode:@"USD"];
</pre>
Swift:
<pre>
AppsFlyerLib.shared().currencyCode = "USD"
</pre>
Expand Down Expand Up @@ -302,9 +288,9 @@ NS_SWIFT_NAME(waitForATTUserAuthorization(timeoutInterval:));
/**
For advertisers who wrap OneLink within another Universal Link.
An advertiser will be able to deeplink from a OneLink wrapped within another Universal Link and also log this retargeting conversion.
Objective-C:
<pre>
[[AppsFlyerLib shared] setResolveDeepLinkURLs:@[@"domain.com", @"subdomain.domain.com"]];
</pre>
Expand All @@ -313,9 +299,9 @@ NS_SWIFT_NAME(waitForATTUserAuthorization(timeoutInterval:));

/**
For advertisers who use vanity OneLinks.
Objective-C:
<pre>
[[AppsFlyerLib shared] oneLinkCustomDomains:@[@"domain.com", @"subdomain.domain.com"]];
</pre>
Expand All @@ -338,26 +324,26 @@ NS_SWIFT_NAME(waitForATTUserAuthorization(timeoutInterval:));
Enable the collection of Facebook Deferred AppLinks
Requires Facebook SDK and Facebook app on target/client device.
This API must be invoked prior to initializing the AppsFlyer SDK in order to function properly.
Objective-C:
<pre>
[[AppsFlyerLib shared] enableFacebookDeferredApplinksWithClass:[FBSDKAppLinkUtility class]]
</pre>
Swift:
<pre>
AppsFlyerLib.shared().enableFacebookDeferredApplinks(with: FBSDKAppLinkUtility.self)
</pre>
@param facebookAppLinkUtilityClass requeries method call `[FBSDKAppLinkUtility class]` as param.
*/
- (void)enableFacebookDeferredApplinksWithClass:(Class _Nullable)facebookAppLinkUtilityClass;

/**
Use this to send the user's emails
@param userEmails The list of strings that hold mails
@param type Hash algoritm
*/
Expand All @@ -373,9 +359,9 @@ NS_SWIFT_NAME(waitForATTUserAuthorization(timeoutInterval:));

/**
Use this method to log an events with mulitple values. See AppsFlyer's documentation for details.
Objective-C:
<pre>
[[AppsFlyerLib shared] logEvent:AFEventPurchase
withValues: @{AFEventParamRevenue : @200,
Expand All @@ -384,16 +370,16 @@ NS_SWIFT_NAME(waitForATTUserAuthorization(timeoutInterval:));
AFEventParamContentId: @"092",
AFEventParamReceiptId: @"9277"}];
</pre>
Swift:
<pre>
AppsFlyerLib.shared().logEvent(AFEventPurchase,
withValues: [AFEventParamRevenue : "1200",
AFEventParamContent : "shoes",
AFEventParamContentId: "123"])
</pre>
@param eventName Contains name of event that could be provided from predefined constants in `AppsFlyerLib.h`
@param values Contains dictionary of values for handling by backend
*/
Expand All @@ -407,7 +393,7 @@ NS_SWIFT_NAME(logEvent(name:values:completionHandler:));
/**
To log and validate in app purchases you can call this method from the completeTransaction: method on
your `SKPaymentTransactionObserver`.
@param productIdentifier The product identifier
@param price The product price
@param currency The product currency
Expand All @@ -426,28 +412,28 @@ NS_SWIFT_NAME(logEvent(name:values:completionHandler:));

/**
To log location for geo-fencing. Does the same as code below.
<pre>
AppsFlyerLib.shared().logEvent(AFEventLocation, withValues: [AFEventParamLong:longitude, AFEventParamLat:latitude])
</pre>
@param longitude The location longitude
@param latitude The location latitude
*/
- (void)logLocation:(double)longitude latitude:(double)latitude NS_SWIFT_NAME(logLocation(longitude:latitude:));

/**
This method returns AppsFlyer's internal id(unique for your app)
@return Internal AppsFlyer Id
*/
- (NSString *)getAppsFlyerUID;

/**
In case you want to log deep linking. Does the same as `-handleOpenURL:sourceApplication:withAnnotation`.
@warning Prefered to use `-handleOpenURL:sourceApplication:withAnnotation`.
@param url The URL that was passed to your AppDelegate.
@param sourceApplication The sourceApplication that passed to your AppDelegate.
*/
Expand All @@ -456,7 +442,7 @@ NS_SWIFT_NAME(logEvent(name:values:completionHandler:));
/**
In case you want to log deep linking.
Call this method from inside your AppDelegate `-application:openURL:sourceApplication:annotation:`
@param url The URL that was passed to your AppDelegate.
@param sourceApplication The sourceApplication that passed to your AppDelegate.
@param annotation The annotation that passed to your app delegate.
Expand All @@ -469,7 +455,7 @@ NS_SWIFT_NAME(logEvent(name:values:completionHandler:));
Call this method from inside of your AppDelegate `-application:openURL:options:` method.
This method is functionally the same as calling the AppsFlyer method
`-handleOpenURL:sourceApplication:withAnnotation`.
@param url The URL that was passed to your app delegate
@param options The options dictionary that was passed to your AppDelegate.
*/
Expand All @@ -478,34 +464,34 @@ NS_SWIFT_NAME(logEvent(name:values:completionHandler:));
/**
Allow AppsFlyer to handle restoration from an NSUserActivity.
Use this method to log deep links with OneLink.
@param userActivity The NSUserActivity that caused the app to be opened.
*/
- (BOOL)continueUserActivity:(NSUserActivity * _Nullable)userActivity
restorationHandler:(void (^ _Nullable)(NSArray * _Nullable))restorationHandler NS_AVAILABLE_IOS(9_0) API_UNAVAILABLE(macos);

/**
Enable AppsFlyer to handle a push notification.
@see [Learn more here](https://support.appsflyer.com/hc/en-us/articles/207364076-Measuring-Push-Notification-Re-Engagement-Campaigns)
@warning To make it work - set data, related to AppsFlyer under key @"af".
@param pushPayload The `userInfo` from received remote notification. One of root keys should be @"af".
*/
- (void)handlePushNotification:(NSDictionary * _Nullable)pushPayload;


/**
Register uninstall - you should register for remote notification and provide AppsFlyer the push device token.
@param deviceToken The `deviceToken` from `-application:didRegisterForRemoteNotificationsWithDeviceToken:`
*/
- (void)registerUninstall:(NSData * _Nullable)deviceToken;

/**
Get SDK version.
@return The AppsFlyer SDK version info.
*/
- (NSString *)getSDKVersion;
Expand All @@ -519,25 +505,25 @@ NS_SWIFT_NAME(logEvent(name:values:completionHandler:));
Used to force the trigger `onAppOpenAttribution` delegate.
Notice, re-engagement, session and launch won't be counted.
Only for OneLink/UniversalLink/Deeplink resolving.
@param URL The param to resolve into -[AppsFlyerLibDelegate onAppOpenAttribution:]
*/
- (void)performOnAppAttributionWithURL:(NSURL * _Nullable)URL;

/**
@brief This property accepts a string value representing the host name for all endpoints.
Can be used to Zero rate your application’s data usage. Contact your CSM for more information.
@warning To use `default` SDK endpoint – set value to `nil`.
Objective-C:
<pre>
[[AppsFlyerLib shared] setHost:@"example.com"];
</pre>
Swift:
<pre>
AppsFlyerLib.shared().host = "example.com"
</pre>
Expand All @@ -563,7 +549,7 @@ NS_SWIFT_NAME(logEvent(name:values:completionHandler:));

/**
API to shut down all SDK activities.
@warning This will disable all requests from AppsFlyer SDK.
*/
@property(atomic) BOOL isStopped;
Expand Down
9 changes: 0 additions & 9 deletions ios/RNAppsFlyer.m
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,6 @@ -(NSError *) callSdkInternal:(NSDictionary*)initSdkOptions {
[AppsFlyerLib shared].delegate = self;
}

if (interval != 0 && interval != nil){
double timeoutInterval = [interval doubleValue];
[[AppsFlyerLib shared] waitForATTUserAuthorizationWithTimeoutInterval:timeoutInterval];
}

[AppsFlyerLib shared].appleAppID = appId;
[AppsFlyerLib shared].appsFlyerDevKey = devKey;
[AppsFlyerLib shared].isDebug = isDebug;
Expand Down Expand Up @@ -444,10 +439,6 @@ -(void) reportOnSuccess:(NSString *)data type:(NSString*) type {
successCallback(@[SUCCESS]);
}

RCT_EXPORT_METHOD(disableAdvertisingIdentifier:(BOOL)shouldDisable) {
[AppsFlyerLib shared].disableAdvertisingIdentifier = shouldDisable;
}

RCT_EXPORT_METHOD(disableCollectASA: (BOOL)shouldDisable) {
[AppsFlyerLib shared].disableCollectASA = shouldDisable;
}
Expand Down
2 changes: 1 addition & 1 deletion react-native-appsflyer.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ Pod::Spec.new do |s|
s.source_files = 'ios/**/*.{h,m}'
s.platform = :ios, "8.0"
s.static_framework = true
s.dependency 'AppsFlyerFramework', '~> 6.0.5'
s.dependency 'appsflyer-apple-sdk-qa/NoIDFA', '6.1.1.25'
s.dependency 'React'
end

0 comments on commit 4e55ef1

Please sign in to comment.