{ "id": "163082", "key": "TIMOB-23884", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "11", "description": "Is not a bug in our product", "name": "Not Our Bug" }, "resolutiondate": "2016-09-11T14:46:09.000+0000", "created": "2016-09-08T23:01:39.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [ { "id": "17706", "name": "Release 5.4.0", "archived": false, "released": true, "releaseDate": "2016-08-11" } ], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2018-08-06T17:52:04.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "We are using ti.safaridialog to launch a web page in our app. Our web page on submit will change the window.location.href to a url scheme we are using for our app (dwea://anything). Instead of going back to the app the safaridialog stays up and the screen goes blank. Hitting Done is the only way to get back. This was working on iOS 9.3 and is no longer working with iOS 10.\r\n\r\nAlso the link we are setting to href works in Safari and goes back to the app. (dwea://anything)\r\n\r\nAt first I thought this might be an Apple bug, but then I tried using Cluster, which is an app in the app store that uses SFSafariViewController and it works on iOS 10 and goes back to the app.\r\nhttps://library.launchkit.io/how-ios-9-s-safari-view-controller-could-completely-change-your-app-s-onboarding-experience-2bcf2305137f#.q0qo38uoi", "attachment": [], "flagged": false, "summary": "iOS: SafariDialog is not redirecting back to app", "creator": { "name": "cthomas", "key": "cthomas", "displayName": "Christy Thomas", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "cthomas", "key": "cthomas", "displayName": "Christy Thomas", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Appcelerator Studio 4.7", "comment": { "comments": [ { "id": "395706", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, Can you try with the latest SDK 5.4.0.GA? It would be helpful if you provide a full test case and a list of steps to follow for us to successfully regenerate the issue. We will look into it. Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2016-09-09T18:30:24.000+0000", "updated": "2016-09-09T18:30:24.000+0000" }, { "id": "395725", "author": { "name": "cthomas", "key": "cthomas", "displayName": "Christy Thomas", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I tried with 5.4.0.GA and I still see the same problem.\r\n\r\nI'm now working on a sample app with a repo for you.", "updateAuthor": { "name": "cthomas", "key": "cthomas", "displayName": "Christy Thomas", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-09-09T19:03:44.000+0000", "updated": "2016-09-09T19:03:44.000+0000" }, { "id": "395727", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~cthomas] I'm already investigating it by opening the dialog to a custom page that redirects to {{fb://}}. After clicking back, it will open the app again, which should match that behavior. If that does not work, I will create a quick app that redirects back so we have a full loop. I will update you when I know more. And just out of curiosity: It should have the same behavior on iOS 9, right?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-09T19:07:21.000+0000", "updated": "2016-09-09T19:08:19.000+0000" }, { "id": "395733", "author": { "name": "cthomas", "key": "cthomas", "displayName": "Christy Thomas", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thanks. This works great on iOS 9 and does not work on iOS 10.\r\n\r\nMy safari dialog is presenting a web page with a button that redirects back to my app with window.location.href=\"myapp://\". I'm not clicking back. The Done button in the safari dialog works fine.", "updateAuthor": { "name": "cthomas", "key": "cthomas", "displayName": "Christy Thomas", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-09-09T19:16:56.000+0000", "updated": "2016-09-09T19:16:56.000+0000" }, { "id": "395740", "author": { "name": "cthomas", "key": "cthomas", "displayName": "Christy Thomas", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I have a feeling it has to do with the resumed app event as we are looking for this and then we close the safari dialog. My guess is the source may have changed. I'm still troubleshooting and the unfortunate thing is I only have an iPad to test on and the debugging is very limited. NSLog no longer works and nothing from titanium Ti.API.error is being output in the log. https://forums.developer.apple.com/thread/49323\r\n\r\n{code}\r\nTi.App.addEventListener('resumed', function(e) {\r\n var args = Ti.App.getArguments();\r\n // only do something if this was launched via safari dialog\r\n if (args.source == 'com.apple.SafariViewService') {\r\n Alloy.eventDispatcher.trigger('appLaunch:browserUrl', args); // this will close the safari dialog\r\n }\r\n }\r\n});\r\n{code}\r\n\r\n", "updateAuthor": { "name": "cthomas", "key": "cthomas", "displayName": "Christy Thomas", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-09-09T19:32:21.000+0000", "updated": "2016-09-09T19:32:21.000+0000" }, { "id": "395746", "author": { "name": "cthomas", "key": "cthomas", "displayName": "Christy Thomas", "active": true, "timeZone": "America/Los_Angeles" }, "body": "So I think it might be redirecting to the app, but the 'resumed' event is not being triggered. This is where we then close the safari dialog. Even if I remove the check for args.source it still doesn't close the safari dialog.", "updateAuthor": { "name": "cthomas", "key": "cthomas", "displayName": "Christy Thomas", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-09-09T19:50:41.000+0000", "updated": "2016-09-09T19:50:41.000+0000" }, { "id": "395748", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Here is my current demo-code:\r\n\r\n{code:javascript}\r\nvar safari = require(\"ti.safaridialog\");\r\n\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: \"#fff\"\r\n});\r\n\r\nvar btn = Ti.UI.createButton({\r\n title: \"Open safari dialog\"\r\n});\r\n\r\nbtn.addEventListener(\"click\", function() {\r\n Ti.API.warn(\"Clicked!\");\r\n\r\n safari.open({\r\n\t\turl:\"http://hans-knoechel.de/TIMOB-23884.php\",\r\n\t\ttitle:\"Hello World\",\r\n\t\ttintColor:\"red\",\r\n\t});\r\n});\r\n\r\nTi.App.addEventListener(\"resumed\", function() {\r\n safari.close();\r\n});\r\n\r\nwin.add(btn);\r\nwin.open();\r\n{code}\r\n\r\nIt opens the Facebook-app and using the iOS 10 back-button in the top-left corner of the status-bar, we can trigger the event. Let me debug the source next.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-09T20:04:16.000+0000", "updated": "2016-09-09T20:04:16.000+0000" }, { "id": "395750", "author": { "name": "cthomas", "key": "cthomas", "displayName": "Christy Thomas", "active": true, "timeZone": "America/Los_Angeles" }, "body": "You have a bit different repro than I do. I'm not using a back-button in the top left corner of the status-bar. I'm using a button on my web page that is opened in the safari dialog.\r\n\r\nI am using the safaridialogissue:// as the window.location.href that I defined in the plist section of my tiapp.xml file as shown below.\r\n\r\n{code}\r\n CFBundleURLTypes \r\n \r\n \r\n CFBundleURLName \r\n com.test.safaridialogissue\r\n CFBundleURLSchemes \r\n \r\n safaridialogissue\r\n \r\n \r\n \r\n{code}\r\n\r\nChange your http://hans-knoechel.de/TIMOB-23884.php to have the Open Facebook link actually open your app with the url scheme you define:\r\n\r\n{code}\r\n\r\n\r\n\r\n{code}\r\n\r\n\r\nIf I open my web page in Safari (click on the navigation icon in the safari dialog toolbar) and click on the 'Click Me' link it will go back to my app and close the safari dialog. It will not close the safari dialog when clicking on 'Click Me' in the safari dialog. Does the 'resumed' event no longer get called when it is resumed and a Safari Dialog is open?", "updateAuthor": { "name": "cthomas", "key": "cthomas", "displayName": "Christy Thomas", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-09-09T20:22:25.000+0000", "updated": "2016-09-09T20:22:25.000+0000" }, { "id": "395751", "author": { "name": "cthomas", "key": "cthomas", "displayName": "Christy Thomas", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Also tintColor setting is not working for me on iOS 10 (AC-4435). I'm not seeing your \"red\" color either. That worked in iOS 9.", "updateAuthor": { "name": "cthomas", "key": "cthomas", "displayName": "Christy Thomas", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-09-09T20:26:42.000+0000", "updated": "2016-09-09T20:26:42.000+0000" }, { "id": "395783", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Yes, already have those covered in my changes (same with {{preferredBarTintColor}} that will be exposed as {{barColor}} on iOS 10). I will let you know about updated on the redirect thing before.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-09T22:36:14.000+0000", "updated": "2016-09-09T22:36:14.000+0000" }, { "id": "395830", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~cthomas] After some research, I first thought it's the same as in TIMOB-23890, but that's most likely something related to the FB-SDK, since native devs run into the same kind of issues. Then I found [this thread|https://forums.developer.apple.com/thread/62012] that is suggesting to change the way to open the controller, so I will try that next. Another thing I noticed is that the dialog does not open modal but as a sub-window. Did you see this as well?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-11T14:19:29.000+0000", "updated": "2016-09-11T14:19:29.000+0000" }, { "id": "395831", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Ok, I have the testing-environment set-up. I open the redirect-app from the web-url that is passed to the safaridialog. In that app, i have a \"back to other app\" button, that opens the app again. What I notice is that the source is \"com.test.safaridialogissue\", not \"com.apple.SafariViewService\" which makes sense, because the app is opened by a different app. So I'm coming to the conclusion that you should do the check whether the dialog is open our not by checking is {{isOpen}} property in the {{resume}} event instead. I guess Apple simply removed the \"old\" SafariViewService identifier to match the \"actual\" source-behavior. \r\n\r\nModule-build (custom) used: https://www.dropbox.com/s/4k62a2ub51vrp51/ti.safaridialog-iphone-1.0.5.zip?dl=1\r\n\r\nResolving this issue as \"Not our Bug\" for now, unless we find a different evidence. Thank you!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-11T14:46:01.000+0000", "updated": "2016-09-11T14:49:30.000+0000" }, { "id": "395834", "author": { "name": "cthomas", "key": "cthomas", "displayName": "Christy Thomas", "active": true, "timeZone": "America/Los_Angeles" }, "body": "In my testing I am finding that 'resumed' in my test appcelerator app is not being triggered when calling safaridialogissue:// from the ti.safaridialog. If I do safaridialogissue:// from the Safari browser 'resumed' is triggered. I put an alert at the top of the event listener even before I am looking at the args.source from var args = Ti.App.getArguments();. I only see the alert from Safari browser and not from ti.safaridialog.\r\n\r\nI'm going to try your ti.safaridialog that you uploaded. I didn't see that in the above test.\r\n\r\n", "updateAuthor": { "name": "cthomas", "key": "cthomas", "displayName": "Christy Thomas", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-09-11T15:10:11.000+0000", "updated": "2016-09-11T15:15:37.000+0000" }, { "id": "395835", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "I am using the module build attached to the last comment, please test that and make sure the 1.0.5 is selected.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-11T15:14:28.000+0000", "updated": "2016-09-11T15:14:28.000+0000" }, { "id": "395836", "author": { "name": "cthomas", "key": "cthomas", "displayName": "Christy Thomas", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I tried your attached module and I still see 'resumed' is not being triggered.\r\n\r\nI did see the tintColor working so I know the new module is being used. Thanks for that fix! ", "updateAuthor": { "name": "cthomas", "key": "cthomas", "displayName": "Christy Thomas", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-09-11T15:21:41.000+0000", "updated": "2016-09-11T15:21:41.000+0000" }, { "id": "395837", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Ok, so it must be something with your resume-event not being placed globally enough to be always called and/or some other process in your app is intercepting it. As I can not reproduce it, we can't do much right now.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-11T15:26:11.000+0000", "updated": "2016-09-11T15:26:11.000+0000" }, { "id": "395839", "author": { "name": "cthomas", "key": "cthomas", "displayName": "Christy Thomas", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I reproduced it in my app and this sample app below:\r\n\r\nhttps://www.dropbox.com/s/3zv12afg1ge64sp/SafariDialogIssue.zip?dl=0\r\n\r\nCan you try this and see if you are able to reproduce the problem?", "updateAuthor": { "name": "cthomas", "key": "cthomas", "displayName": "Christy Thomas", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-09-11T15:40:03.000+0000", "updated": "2016-09-11T15:40:03.000+0000" }, { "id": "395877", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "There are many issues with your sample project:\r\n- 5.4.0.GA instead of 5.5.0 used (required for iOS 10)\r\n- The {{CFBundleURLTypes}} key (and others) contain spaces before and after the key/value\r\n- The {{resumed}} event-listener is placed locally instead of globally (Alloy.js is for that)\r\n\r\nAnd finally, the {{resumed}} event is not supposed to fire when you work with the SafariDialog, because you don't leave the app. We just bubble the event from the native {{- (void)applicationDidBecomeActive:(UIApplication *)application}} delegate. And since that one does only fire after leaving and returning to the app, it won't be fired if you don't leave it. In my other use-case, I made two apps where I switched to that one and returned, which triggered the resumed event and closed the dialog. \r\n\r\n*EDIT*: Just added another test-case to my environment: I can now confirm that the above delegate *does* fire for iOS < 10 but not on iOS 10. You might want to file a bugreport to Apple, I'm wondering why they changed that and if other people ran into that issue. But for now that is the best way to go. ", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-12T10:35:36.000+0000", "updated": "2016-09-12T10:40:58.000+0000" }, { "id": "395887", "author": { "name": "cthomas", "key": "cthomas", "displayName": "Christy Thomas", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I am unable to find out how to install 5.5.0. It seems 5.4.0 is still the latest. Where can I get the pre-release?\r\n\r\nIs that rule about the 'resumed' event not supposed to fire when you work with the SafariDialog new? In iOS 9 it was fired. If that is not the case how am I supposed to get something done in SafariDailog and then get back to my app? The web page has to be able to interact with the app that was running.\r\n\r\nThe whole point of using the SafariDialog is to gather additional information and then get back to the app. What is the proper way to do that. I want to get back to the same app, not another app. I don't have 2 apps.\r\n\r\nEDIT: I do have an Apple bug open and I have added the information you gave me to it. Thank you. The Apple bug id is 28211987.", "updateAuthor": { "name": "cthomas", "key": "cthomas", "displayName": "Christy Thomas", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-09-12T12:59:57.000+0000", "updated": "2016-09-12T13:01:13.000+0000" }, { "id": "395889", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "The 5.5.0.GA will be released tomorrow with the official iOS 10 release. You can get the current build from [here|builds.appcelerator.com/#5_5_X], we well as from the Beta- and RC-versions we released over the last weeks. As said above, it seems like either Apple changed that behavior on purpose or they broke the functionality. It's nothing we intercept with our SDK. Let me check how the whole thing behaves natively, I get your point and trying to help as much as possible :-)\r\n\r\n*EDIT*: Thanks for the bugreport, I'm really interested on what they will answer. Thanks for that! Unfortunately, they have several more issues that were still present in the 7.0 GM last week, so there will likely be a 7.0.1 very soon, hopefully with that one as well - or they give a good reason why it's not firing.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-12T13:02:40.000+0000", "updated": "2016-09-12T13:04:24.000+0000" }, { "id": "395890", "author": { "name": "cthomas", "key": "cthomas", "displayName": "Christy Thomas", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I was looking at the apple UIApplicationDelegate and wondered if other events are calls are happening like applicationWillEnterForeground.\r\n\r\nThe Cluster app that I originally posted in this ticket works with iOS 10 so they must have figured out a way to get back to the app after using SFSafariViewController. They jump out to FB for login and then get back to the app and with my investigation it looks like they are using the url scheme to do so.\r\n\r\nI really appreciate all your help!\r\n\r\nI've had the Apple bug open since Thursday and no one has responded to it yet. Do you have any tricks to get action on that? Maybe more than one person reporting it.", "updateAuthor": { "name": "cthomas", "key": "cthomas", "displayName": "Christy Thomas", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-09-12T13:15:33.000+0000", "updated": "2016-09-12T15:30:04.000+0000" }, { "id": "395901", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "I created a native reproducible case that you can hand out to Apple: https://www.dropbox.com/s/jqfz1rahowvl228/safaridialogtest.zip?dl=1 As commented in the project, we might be able to expose a new event whenever the openURL delegate is called and provide the content of the launchOptions (aka Ti.App.getArguments()) there. Don't see a problem there. But that would go into 6.0.0, since 5.5.0 will already be released tomorrow.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-12T16:58:37.000+0000", "updated": "2016-09-12T16:58:37.000+0000" }, { "id": "395902", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Follow-up ticket for that: TIMOB-23896", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-12T17:02:49.000+0000", "updated": "2016-09-12T17:02:57.000+0000" }, { "id": "395904", "author": { "name": "cthomas", "key": "cthomas", "displayName": "Christy Thomas", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thanks. I have added that link to the Apple ticket.\r\n\r\nHow long before 6.0.0? That sounds like it will be a while vs a 5.6.0 release.\r\n\r\nOur customers will not be able to use our app as a result of this issue on iOS 10 and new iPads will come with 10 so they won't be able to avoid the update.", "updateAuthor": { "name": "cthomas", "key": "cthomas", "displayName": "Christy Thomas", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-09-12T17:13:41.000+0000", "updated": "2016-09-12T17:13:41.000+0000" }, { "id": "440265", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing as \"not our bug\". If you disagree, please reopen.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-06T17:52:04.000+0000", "updated": "2018-08-06T17:52:04.000+0000" } ], "maxResults": 26, "total": 26, "startAt": 0 } } }