Titanium JIRA Archive
Appcelerator Community (AC)

[AC-4125] Ti.App.iOS 'continueactivity' event is not fired on distribution build

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionFixed
Resolution Date2016-07-29T17:02:27.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsn/a
ReporterAbdiel Aviles
AssigneeShak Hossain
Created2016-07-22T00:26:47.000+0000
Updated2016-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 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:

Run your app in debug mode. The continueactivity will be fired and your code executed.

Build a distribution app, run it. The continueactivity will NOT be fired and your code will NOT be executed.

Comments

  1. Abdiel Aviles 2016-07-22

    I just tested with the 5.4.0 nightly and it works!

JSON Source