Closed Pigpocket closed 1 year ago
The current implementation is still considered as open beta
@UIApplicationDelegateAdaptor
the
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool
should be visible That did it, thanks, no more crash.
Our app is fully SwiftUI. So to be clear, we should have:
_ = appDelegate.application(UIApplication.shared, open: url)
in our .onOpenURL
method and the AppDelegate
configured as I have above, yes? I.e. no longer using PendoManager.shared().initWith(url)
ok if its fully swiftui UI, your app entry point should have @main on SwiftUI struct.
In that case u still should have Appdelegete . In the entry point struct u must have @UIApplicationDelegateAdaptor
like: @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
(please look at the example in the integration part here).
and then appDelegate.application(UIApplication.shared, open: url, options: [:])
should work. (if It doesnt Iet me know I will look at it again maybe Apple has changed something).
Dont forget to call the setup api with your key prior to pairing or doing something.
@Pigpocket I am closing the issue
I'm getting a consistent crash with the following when trying to run the beta with the branch set to
swiftui
:Also, in our non-beta implementation, we are calling this init method in the
.onOpenUrl
method:PendoManager.shared().initWith(url)
According to the docs for SwiftUI in your package, it should be replaced with the below? Xcode autocompletes the optional version of
application
, but if I remove the question mark, it views theopen
parameter as an extra argument, so we wouldn’t be able to pass in the url. The below throws an error:To sort that out, I tried calling that function in my
AppDelegate
, so now myAppDelegate
looks like this: