-
Notifications
You must be signed in to change notification settings - Fork 222
feat: add Swift AppDelegate support for expo #624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add Swift AppDelegate support for expo #624
Conversation
- Add automatic Swift AppDelegate modification for AppsFlyer plugin - Support Expo SDK 53+ default Swift AppDelegate template - Add Bridging Header automatic import for Swift projects - Maintain backward compatibility with Objective-C AppDelegate
|
Really appreciate for this one. Just one comment, some time ago when I tried to do it manually in the expo app I was having issues with deeplinks at specific circumstances. Can you please make sure that all possible deeplink paths work properly yet? AFAIR it was during the cold start where deeplinks weren't catched by SDK. |
Thanks for the comment Here are the test cases I covered:
However, since I'm using the free version, I was only able to test with OneLink. |
|
If deep links are not working properly when the app is running in the background on Android, please add the following code to import android.content.Intent
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
setIntent(intent)
}Note: This code differs slightly from the original PR. The original used override fun onNewIntent(intent: Intent?) with a nullable Intent parameter, but this caused compilation errors, so I've updated it to use a non-null Intent parameter. |
I believe it's necessary to add the compatibility for Expo as well. The plugin shouldn't be complex tho |
|
What's the progress on this, need this to upgrade our app... Not sure if any engineers from AppsFlyer are here? |
I guess not, you can create a local patch using patch-package for now |
|
This is blocking our app from upgrading to Expo 53. Hope that this issue gets resolved soon. |
| continue userActivity: NSUserActivity, | ||
| restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void | ||
| ) -> Bool {`; | ||
| const RNAPPSFLYER_SWIFT_CONTINUE_USER_ACTIVITY_CODE = 'AppsFlyerAttribution.shared().continue(userActivity, restorationHandler: nil)'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw your comment that restorationHandler is not being used internally. I do think it is better to work with the external Api in case the internal one ever starts using it. You could work around the error you were getting with:
AppsFlyerAttribution.shared().continue(userActivity) { array in
restorationHandler(array as? [UIUserActivityRestoring])
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion! I think keeping restorationHandler: nil is cleaner for now.
-
Current state: Since AppsFlyer doesn't use
restorationHandlerinternally, we'd be passing unused data through an unnecessary closure. -
Type safety concerns: The suggested
array as? [UIUserActivityRestoring]casting assumes AppsFlyer will always provide the correct type, but we don't have guarantees about their internal implementation. -
Future updates: If AppsFlyer adds functionality that uses
restorationHandler, we'll need to update the library anyway, so we can implement it properly at that point.
I think it's better to keep the code simple and explicit rather than adding complexity for future scenarios. When the feature is actually added, we can implement it then.
I'll follow the AppsFlyer maintainer's opinion on this matter for future implementation.
Thanks!
We’re encountering the same issue as well. Hopefully, it can be resolved soon. |
|
Any news on this? |
|
I've reached out to AppsFlyer support and didn't get any definitive update, just that their product team would look into it. |
|
same, at react native without framework. react-native v0.80.1 |
|
AppsFlyer got back to me and said that the fix will be prioritized for early August. |
- Add shouldUsePurchaseConnector flag support - Add automatic Podfile flag injection with conflict detection - Maintain backward compatibility with manual configurations - Support both shouldUseStrictMode and shouldUsePurchaseConnector flags Builds upon Swift AppDelegate support from PR #624
…lugin - Add shouldUsePurchaseConnector flag support - Add automatic Podfile flag injection with conflict detection - Maintain backward compatibility with manual configurations - Support both shouldUseStrictMode and shouldUsePurchaseConnector flags Builds upon Swift AppDelegate support from PR #624
Add Swift AppDelegate Support for expo
🎯 Overview
This PR extends the plugin to support Swift AppDelegate files for AppsFlyer integration, addressing compatibility with Expo SDK 53+ which now defaults to generating Swift AppDelegate files instead of Objective-C.
📱 Background
AppDelegate.swiftinstead ofAppDelegate.m✨ Changes
AppDelegate.swiftfiles#import <RNAppsFlyer.h>addition to bridging headersSwift AppDelegate Integration
Why restorationHandler: nil?
AppsFlyer doesn't actually use the restorationHandler internally. Evidence from AppsFlyer's own implementation:
nilfor delayed universal link processingRCTLinkingManager, not AppsFlyer🚨 Error Handling
🧪 Test