Skip to content
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

fix(dynamic-links): prevent crash when annotation is null #86

Merged
merged 1 commit into from
May 5, 2022

Conversation

edusperoni
Copy link
Contributor

@edusperoni edusperoni commented May 5, 2022

@cla-bot cla-bot bot added the cla: yes label May 5, 2022
@triniwiz triniwiz merged commit 8a53b8b into NativeScript:main May 5, 2022
@edusperoni edusperoni deleted the fix/dynamic-links-crash branch May 5, 2022 16:10
@henrychavez
Copy link

@triniwiz there is any chance to get a release with this fix today? we are blocked and not able to publish apps on iOS because of this

@community2code
Copy link

community2code commented Jul 7, 2022

I'm facing a iOS device crash when I include the dynamic-links plugin, however this happens only the first time when the App is installed, subsequent re-opens don't cause a problem.

During compilation, I noticed the below error:

Users/vijay/Projects/community/node_modules/@nativescript/firebase-dynamic-links/platforms/ios/src/TNSFirebaseDynamicLinksAppDelegate.swift:30:146: warning: expression implicitly coerced from 'Any?' to 'Any'
return application(app, open: url, sourceApplication: options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String, annotation: options[UIApplication.OpenURLOptionsKey.annotation])
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/vijay/Projects/community/node_modules/@nativescript/firebase-dynamic-links/platforms/ios/src/TNSFirebaseDynamicLinksAppDelegate.swift:30:153: note: provide a default value to avoid this warning
return application(app, open: url, sourceApplication: options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String, annotation: options[UIApplication.OpenURLOptionsKey.annotation])
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?? <#default value#>
/Users/vijay/Projects/community/node_modules/@nativescript/firebase-dynamic-links/platforms/ios/src/TNSFirebaseDynamicLinksAppDelegate.swift:30:153: note: force-unwrap the value to avoid this warning
return application(app, open: url, sourceApplication: options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String, annotation: options[UIApplication.OpenURLOptionsKey.annotation])
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!
/Users/vijay/Projects/community/node_modules/@nativescript/firebase-dynamic-links/platforms/ios/src/TNSFirebaseDynamicLinksAppDelegate.swift:30:153: note: explicitly cast to 'Any' with 'as Any' to silence this warning
return application(app, open: url, sourceApplication: options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String, annotation: options[UIApplication.OpenURLOptionsKey.annotation])
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
as Any
/Users/vijay/Projects/community/node_modules/@nativescript/firebase-dynamic-links/platforms/ios/src/TNSFirebaseDynamicLinksAppDelegate.swift:38:55: warning: 'dynamicLink(fromUniversalLink:)' is deprecated: Use dynamicLinkFromUniversalLinkURL:completion: instead.
dynamicLink = DynamicLinks.dynamicLinks().dynamicLink(fromUniversalLink: url)

Environment setup:

  • Mac OS : 12.4
  • iPhone OS : 15.5
  • NativeScript : 8.2.3

I'm sure the crash is due to the plugin because I've experimented several times by including and excluding the package from the build.

Requesting some assistance on this. Btw, it works fine on Android.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants