titanium-sdk icon indicating copy to clipboard operation
titanium-sdk copied to clipboard

iOS: Various "start up" issues with 12.3.0

Open m1ga opened this issue 4 months ago • 10 comments

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

m1ga avatar Feb 26 '24 14:02 m1ga

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?

hansemannn avatar Apr 15 '24 20:04 hansemannn

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

m1ga avatar Apr 15 '24 20:04 m1ga

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 avatar May 04 '24 18:05 berutas

@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.

m1ga avatar May 04 '24 18:05 m1ga

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

m1ga avatar May 21 '24 15:05 m1ga

Did the user try latest master? I thought I fixed that a few weeks ago

hansemannn avatar May 21 '24 17:05 hansemannn

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.

m1ga avatar May 21 '24 17:05 m1ga

Ahh that one! That should actually be fixed by the other change (#14028), where some other unreported application delegate issues were fixed as well).

hansemannn avatar May 21 '24 17:05 hansemannn

Oh ok :smile: That one will crash right away as mentioned on slack. But good to know that is addressed there already :+1:

m1ga avatar May 21 '24 18:05 m1ga