titanium-sdk
titanium-sdk copied to clipboard
iOS: Various "start up" issues with 12.3.0
I have searched and made sure there are no existing issues for the issue I am filing
- [X] I have searched the existing issues
Description
we have some Slack users with various iOS issues with 12.3.0:
- logs don't start when deploying to a device: https://tidev.slack.com/archives/C03CVQX2A/p1708366917013159 (can reproduce it)
- Ti.Network.registerForPushNotifications callbacks are not working. success, error or callback does not fire: https://tidev.slack.com/archives/C03CVQX2A/p1708193774626049
- custom url schemas not working (
handleurl
is empty): https://tidev.slack.com/archives/C03CVQX2A/p1708951069059309 (can reproduce it, working with 12.2.1)
This PR https://github.com/tidev/titanium-sdk/commit/6e40edbeab8cf39eee91d916c98aa6a3c6921812 did some changes to the start-up behavior so it might be the cause.
Reproducible sample
1: DEBUG=node-ios-device ti build -p ios
will end up in an endless loop:
[INFO] App successfully installed on device: iPhone von Michael
node-ios-device Found 1 device +6ms
node-ios-device Connected devices: 00008020-111 +0ms
Please manually launch the application or press CTRL-C to quit
node-ios-device Trying to connect to port 46464 +254ms
node-ios-device Trying to connect to port 46464 +4ms
node-ios-device Trying to connect to port 46464 +253ms
node-ios-device Trying to connect to port 46464 +254ms
node-ios-device Trying to connect to port 46464 +256ms
3:
const win = Ti.UI.createWindow();
const lbl = Ti.UI.createLabel({text:"-", color:"#000"});
win.add(lbl);
win.open();
Ti.App.iOS.addEventListener('handleurl', event => {
lbl.text = event.launchOptions.url;
});
tiapp.xml
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<!-- same as ti:app/id -->
<string>com.miga.test</string>
<key>CFBundleURLSchemes</key>
<array>
<!-- your custom scheme -->
<string>mycustomapp</string>
</array>
</dict>
</array>
link <a href="mycustomapp://?data=customValue">custom link</a>
Steps to reproduce
run the code
Platform
iOS
SDK version you are using
12.3.0
Alloy version you are using
No response
Okay, so for case 1: DEBUG=node-ios-device ti build -p ios
does not build for device, you probably meant DEBUG=node-ios-device ti build -p ios -p device
?
ah yes, sorry. I always start it with a shortcut, forgot to add all parameters to the example. I use ti build -p ios -T foo
and then the menu but it should be the same with the parameter. It happens for a normal "to device" build
I've found that with 12.2.1 Ti.App.Arguments works as expected but with 12.3.0 it's empty on startup
@berutas can you please test the version you'll find at the bottom of this page: https://github.com/tidev/titanium-sdk/actions/runs/8695958494
Download the zip file and install it with ti sdk install filename.zip
. Then in yout project change the sdk-version to 12.3.0.v20240415210917
and test it again.
as there is another report on slack I've tested Ti.App.arguments
and it looks like it is not working with 12.3.0
const win = Ti.UI.createWindow();
const lbl = Ti.UI.createLabel({text:"-", color:"#000"});
win.add(lbl);
win.open();
Ti.App.iOS.addEventListener('handleurl', event => {
lbl.text = event.launchOptions.url;
});
win.addEventListener("open", function(e){
lbl.text = "open:\n " + Ti.App.arguments.url;
})
When you have the app closed and click on the URLScheme link the Ti.App.arguments.url
are empty on 12.3.0 but are filled with 12.2.1.GA
Did the user try latest master? I thought I fixed that a few weeks ago
Ti.App.iOS.addEventListener('handleurl')
is working but not the Ti.App.arguments.url
. Using the build from 16th or May.
if you want to test it make sure you force close the app. So it will use the open
event when opening it from a link.
Ahh that one! That should actually be fixed by the other change (#14028), where some other unreported application delegate issues were fixed as well).
Oh ok :smile: That one will crash right away as mentioned on slack. But good to know that is addressed there already :+1: