Closed mfrey43 closed 1 month ago
Thanks for the report, I will try to reproduce today
I was not able to reproduce this. I am able to see takeOff being called automatically with the plugin.config being parsed.
We had to make some changes to our file structure for SPM and in doing so also our Pod file. I wonder if the pod was not updated? Could you make sure npx cap sync is called and share the Pod.lock file?
I am looking for this:
- UaCapacitorAirship (2.0.0):
- AirshipFrameworkProxy (= 7.0.0)
- Capacitor
- UaCapacitorAirship/Bootloader (= 2.0.0)
- UaCapacitorAirship/Plugin (= 2.0.0)
- UaCapacitorAirship/Bootloader (2.0.0):
- AirshipFrameworkProxy (= 7.0.0)
- Capacitor
- UaCapacitorAirship/Plugin (2.0.0):
- AirshipFrameworkProxy (= 7.0.0)
- Capacitor
If that is already updated, then could you provide an example project of it not working? If thats not possible we could also arrange a quick call to debug this.
What I am looking for is if https://github.com/urbanairship/capacitor-airship/blob/main/ios/Plugin/AirshipCapacitorAutopilot.swift#L43 is being called
Thank you for the quick response. My pod file looks the same as yours.
I set up an example project using the blank ionic template and added the UaCapacitorAirship plugin. Everything is configured the same minus the appKey/Secret. I used xcode version 15.3 (15E204a) and ran the app in the iPhone 15 Pro 17.2 simulator. (I tested both native and simulator, it behaves the same)
Please let me know if you reproduce it.
I think I see the issue, the npm package is missing the files for the obj-c side of the plugin. I think its because I didnt update this https://github.com/urbanairship/capacitor-airship/blob/main/package.json#L9
That would explain why its working in the example but not for you. Ill get a quick patch out and test the package to see if that fixes it.
Fixed in 2.0.1. Thanks for the help!
Preliminary Info
What Airship dependencies are you using?
"@ua/capacitor-airship": "^2.0.0",
What are the versions of any relevant development tools you are using?
irrelevant
Report
What unexpected behavior are you seeing?
This only affect iOS: The takeoff no longer happens automatically if the plugin configuration is provided via capacitor.config.json. When I call Airship.preferenceCenter.display(preferenceCenterKey) in my code, I receive the error
AirshipFrameworkProxy.AirshipProxyError error 1
and the preference center does not open. When looking up the error, I found this issue which mentions that takeOff() must be called first. If I do that manually, the preference center opens as it should. But according to the docs, configuration via capacitor.config.json is still supported and I don't see anything in the 2.0.0 changelog that would say otherwise. This was working fine in version 1.2.4.What is the expected behavior?
The preference center should open without calling takeOff() first if the plugin configuration is provided in capacitor.config.json
What are the steps to reproduce the unexpected behavior?
Do you have logging for the issue?
Nothing is logged from the plugin because it never takes off.