[AC-4125] Ti.App.iOS 'continueactivity' event is not fired on distribution build
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-07-29T17:02:27.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | n/a |
Reporter | Abdiel Aviles |
Assignee | Shak Hossain |
Created | 2016-07-22T00:26:47.000+0000 |
Updated | 2016-07-29T17:02:27.000+0000 |
Description
SDK: Tested on 5.3.0 and 5.2.2 (probably happening on other versions).
I have a Titanium app that's handling an incoming Universal Link by capturing the iOS On
Add the
Add a file called
Run your app in debug mode. The
Build a distribution app, run it. The
continueactivity
event. This is the code I have:
if(OS_IOS){
Ti.App.iOS.addEventListener('continueactivity', function(e){
if(e.activityType === "NSUserActivityTypeBrowsingWeb"){
alert(e.webpageURL);
}
});
}
This code works perfectly while the app is being debugged but the event is not fired on the distribution build. I have reproduced this behaviour with the Ti Example App.
SO question: http://stackoverflow.com/questions/38503510/ti-app-ios-continueactivity-not-working-on-production-build
How to Reproduce:
Clone the Ti Example App
On alloy.js
, add the iOS continueactivity
event handler as shown above.
Add the associated-domains
entitlement (this must also be configured with the app id on the Apple Dev Center). In order to configure this with Ti you must add a file called Entitlements.plist
like:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:example.com</string>
</array>
</dict>
</plist>
Add a file called apple-app-site-association
to the root of your HTTPS domain (eg: https://example.com). The file is a JSON object as described in the [Apple documentation](https://developer.apple.com/library/ios/documentation/General/Conceptual/AppSearch/UniversalLinks.html):
{
"applinks": {
"apps": [],
"details": [
{
"appID": "YOUR.example.app.id",
"paths": [ "*"]
}
]
}
}
Once your app and your domain are configured:
I just tested with the 5.4.0 nightly and it works!