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(ios): check if app is booted before sending notifications #10565
Conversation
|
@hansemannn, in another PR, I'm looking into adding a new I think your code change is fine. I just wanted to let you know that I plan on transitioning the code to use the above solution in the future. It's especially needed when we start adding bootstrap scripts which will display UI before the "app.js" gets executed. What do you think? |
Hey @jquick-axway! In general, I am fine renaming it. But - especially for iOS - the |
@hansemannn, I think we might be talking about 2 different things. Sorry about the confusion. The Now here's a potential issue that can happen on iOS in the future. If we did set up a bootstrap script to show UI on startup (let's say to show a dialog), the "app.js" won't be loaded until after that bootstrap UI has been cleared. This means that a "handleurl" event fired while a bootstrap UI is displayed won't be received by the "app.js" listeners since the "app.js" hasn't been loaded yet. That's the potential future issue. For "handleurl", perhaps this behavior is okay, but this behavior might not be okay for notification handling. That's the potential issue that the "started" event solves. |
@hansemannn Changes looks good to me. Can you please give a test case for QE to verify. Please fix linking issue. Thanks! |
You mean linting? Can you post the command to lint again? Test case:
// Before, this event only fired if the app was opened before. On a cold
// start, it was ignored.
Ti.App.iOS.addEventListener('handleurl', function (event) {
Ti.API.warn(event);
});
var win = Ti.UI.createWindow({ backgroundColor: '#fff' });
win.open();
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>com.yourdomain.yourappprefix</string>
<key>CFBundleURLSchemes</key>
<array>
<string>myapp</string>
</array>
</dict>
</array>
|
@hansemannn Yes. Linting :). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CR passed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FR Passed Using a variation of test case provided above.
var label1 = Ti.UI.createLabel({
color: '#900',
font: { fontSize:48 },
shadowColor: '#aaa',
shadowOffset: {x:5, y:5},
shadowRadius: 3,
text: 'A simple label',
textAlign: Ti.UI.TEXT_ALIGNMENT_CENTER,
top: 30,
width: Ti.UI.SIZE, height: Ti.UI.SIZE
});
Ti.App.iOS.addEventListener('handleurl', function (event) {
Ti.API.warn(event);
win.add(label1);
});
var win = Ti.UI.createWindow({ backgroundColor: '#fff' });
win.open();
Test Environment
iPhone 6 Sim (12.1)
APPC CLI: 7.0.9
Operating System Name: Mac OS Mojave
Operating System Version: 10.14.2
Node.js Version: 8.9.1
Xcode 10.1
JIRA: https://jira.appcelerator.org/browse/TIMOB-26687