Closed DontGiveAFck closed 3 years ago
Hi @DontGiveAFck Thank you for reaching out to us.
In AppDelegate.swift
please replace AppsFlyerLib
with AppsFlyerAttribution
. If the class is not found in Swift, you should create a Swift Bridging Header and add the next import to the file you created #import <AppsFlyerPlugin.h>
@amit-kremer93 @pazlavi after adding Bridging file getting No such module 'AppsFlyerAttribution' error in AppDelegate.swift file
You should import AppsFlyerPlugin
@pazlavi the same error for AppsFlyerPlugin
Please make sure to build the project first. After you build the project, you probably be able to use the class directly (without the import in AppDelegate)
@pazlavi you were right, now I'm able to use AppsFlyerAttribution, I did changes, but initial issue still exists - registerDeepLink not triggered on 'cold' ios app start current AppDelegate.swift file:
The issue is that you provide nil
as the restorationHandler
.
To enable a nil
restorationHandler
, please change this line in our plugin file to else if(self.userActivity)
.
I have the same problem on iOS 14.4 with ionic cordova .
I have added the required Plugin + Code part ( I have left out only the part for ios less than 8)
But UDL data is not passed when I click the link. Link click opens the app, but not passing variables.
Could you hint why @pazlavi ?
here is my AppDelegate.m
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
//
// AppDelegate.m
// Dignisi
//
// Created by ___FULLUSERNAME___ on ___DATE___.
// Copyright ___ORGANIZATIONNAME___ ___YEAR___. All rights reserved.
//
#import "AppDelegate.h"
#import "MainViewController.h"
#import "AppsFlyerPlugin.h"
#import <AppTrackingTransparency/AppTrackingTransparency.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
self.viewController = [[MainViewController alloc] init];
if (@available(iOS 14, *)) {
[ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
//If you want to do something with the pop-up
}];
}
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
// Deep linking
// Open URI-scheme for iOS 9 and above
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary *) options {
// version >= 6.2.30
[[AppsFlyerAttribution shared] handleOpenUrl:url options:options];
// version < 6.2.30
[[AppsFlyerLib shared] handleOpenUrl:url options:options];
return YES;
}
// Open Universal Links
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler {
// version >= 6.2.30
[[AppsFlyerAttribution shared] continueUserActivity:userActivity restorationHandler:restorationHandler];
//version < 6.2.30
[[AppsFlyerLib shared] continueUserActivity:userActivity restorationHandler:restorationHandler];
return YES;
}
@end
Hi @gelinger777, What is the plugin version you are using?
If you are using V6.3.00 and above, please check this guide (Not need to add any code to AppDelegate.m
)
For V6.2.30 up to V6.2.60:
// Deep linking
// Open URI-scheme for iOS 9 and above
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary *) options {
[[AppsFlyerAttribution shared] handleOpenUrl:url options:options];
return YES;
}
// Open Universal Links
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler {
[[AppsFlyerAttribution shared] continueUserActivity:userActivity restorationHandler:restorationHandler];
return YES;
}
Below V6.2.30:
// Deep linking
// Open URI-scheme for iOS 9 and above
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary *) options {
[[AppsFlyerLib shared] handleOpenUrl:url options:options];
return YES;
}
// Open Universal Links
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler {
[[AppsFlyerLib shared] continueUserActivity:userActivity restorationHandler:restorationHandler];
return YES;
}
If any additional assistance is required here, we kindly ask you to submit a support ticket to support@appsflyer.com.
When submitting the ticket, please specify your AppsFlyer sign-up (account) email, app ID, reproduction steps, code snippets, logs, the links you used, and any additional relevant information.
Report
Platform
iphone 12 (ios 14.4) ionic 5, capacitor 2 Xcode 12.4
Plugin Version
cordova-plugin-appsflyer-sdk: 6.2.60
On what Platform are you having the issue?
ios (on android everything works as expected)
What did you do?
I configured universal deep links for ios and app links for android.
When I open universal link on ios (iphone 12, v14.4) device with fully closed application (app not running on background) - app opened but registerDeepLink or registerOnAppOpenAttribution not called.
Although if app not installed link redirects me to app store and after app installation registerDeepLink called. Also it called when I open link when app is running on background.
What did you expect to happen?
registerDeepLink should be called if I open installed app via universal link.
What happened instead?
App opened but registerDeepLink not called.
Please provide any other relevant information.
Appsflyer init:
AppDelegate.swift:
AppDebug.entitlements :