Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-20220

iOS: Ti.App.iOS.continueactivity not being fired

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Release 5.1.1
    • Fix Version/s: Release 5.4.0
    • Component/s: iOS
    • Labels:
    • Environment:

      Xcode 7.2
      Titanium SDK 5.1.1GA
      iOS 9.1

    • Story Points:
      5
    • Sprint:
      2016 Sprint 07 SDK

      Description

      Issue Description

      In a manner similar to Handoff (https://wiki.appcelerator.org/display/guides2/Handoff+User+Activities), using the Ti.App.iOS.UserActivity API to implement Universal Links in an app. This was to connect my website with the app. Basically this was to allow Safari users to open thea app via a link on the website.

      In the app there is following event handler:

      Ti.App.iOS.addEventListener('continueactivity', function(e){ 
           if (e.activityType === 'NSUserActivityTypeBrowsingWeb') { 
                var url = e.webpageURL; 
                // Display relevant content 
           } 
      }); 
      

      This would listen for the continueactivity event to be fired by iOS and capture the URL from the UserActivity in the function parameters. Then it would display relevant content based on the URL.

      This all worked fine on SDK 5.0.2. But after switching to SDK 5.1.1 it seems as though the 'continueactivity' event is never being fired.

        Issue Links

          Activity

          Hide
          htbryant Harry Bryant added a comment - - edited

          Tested the fix with the demo code provided by Hans Knöchel and found an issue.

          Handing off from iOS9Device1 to iOS9Device2:
          iOS9Device1: Activity moved to a different device.
          iOS9Device2: continueactivity was fired.
          Logs: [ERROR] : UIAlertController is up and showing an alert. ABORTING showing of modal controller

          Handing off from iOS9Device to iOS8Device:
          iOS9Device: Activity moved to a different device.
          iOS8Device: App crashes.
          Xcode Logs:

          Aug  4 15:31:23 Spam kernel[0] <Notice>: xpcproxy[1079] Container: /private/var/mobile/Containers/Data/Application/326B7AB3-16DB-4C33-94A6-B8BC41EF6A71 (sandbox)
          Aug  4 15:31:23 Spam SamusTheBold[1079] <Warning>: SOASTA TouchTest Build : 8244.160
          Aug  4 15:31:23 Spam SamusTheBold[1079] <Warning>: SOASTA TouchTest initializing...
          Aug  4 15:31:23 Spam locationd[60] <Notice>: Gesture EnabledForTopCLient: 0, EnabledInDaemonSettings: 0
          Aug  4 15:31:23 Spam SamusTheBold[1079] <Warning>: Process delegate TiApp(o) : TiHost : NSObject
          Aug  4 15:31:23 Spam SamusTheBold[1079] <Warning>:   added ctDidFinishLaunchingWithOptions
          Aug  4 15:31:23 Spam SamusTheBold[1079] <Warning>:   watching application:didFinishLaunchingWithOptions: : success
          Aug  4 15:31:23 Spam SamusTheBold[1079] <Warning>:   added ctOpenURL
          Aug  4 15:31:23 Spam SamusTheBold[1079] <Warning>:   watching openURL : success
          Aug  4 15:31:23 Spam SamusTheBold[1079] <Warning>: SOASTA TouchTest initialized in 103 msec (#51)
          Aug  4 15:31:23 Spam SamusTheBold[1079] <Error>: assertion failed: 12D508: libxpc.dylib + 71792 [3C982BC2-5B46-305A-9A09-3C3D15332820]: 0x7d
          Aug  4 15:31:23 Spam Unknown[1079] <Error>: 
          Aug  4 15:31:23 Spam SamusTheBold[1079] <Warning>: [DEBUG] Reading stylesheet from: /private/var/mobile/Containers/Bundle/Application/9A54667A-1524-4020-B04D-7E23BBB19F46/SamusTheBold.app/stylesheet.plist
          Aug  4 15:31:23 Spam SamusTheBold[1079] <Warning>: [INFO] SamusTheBold/1.0 (5.4.0.16921ce)
          Aug  4 15:31:23 Spam sharingd[59] <Notice>: 15:31:23.340 : Requesting Handoff payload
          Aug  4 15:31:23 Spam sharingd[59] <Notice>: 15:31:23.643 : Received a new Handoff advertisement from "SAMWISE"
          Aug  4 15:31:23 Spam sharingd[59] <Warning>: [Warning] No delegate was registered that could handle protobuf BC060AC5-021F-4A2D-883F-5FDA9A177137
          Aug  4 15:31:23 Spam sharingd[59] <Warning>: [Warning] No delegate was registered that could handle protobuf BC060AC5-021F-4A2D-883F-5FDA9A177137
          Aug  4 15:31:23 Spam sharingd[59] <Notice>: 15:31:23.719 : Received requested Handoff payload from "SAMWISE" ((null))
          Aug  4 15:31:23 Spam ReportCrash[1080] <Error>: task_set_exception_ports(B07, 400, D03, 0, 0) failed with error (4: (os/kern) invalid argument)
          Aug  4 15:31:23 Spam ReportCrash[1080] <Notice>: ReportCrash acting against PID 1079
          Aug  4 15:31:23 Spam ReportCrash[1080] <Notice>: Formulating crash report for process SamusTheBold[1079]
          Aug  4 15:31:23 Spam SpringBoard[53] <Warning>: BSXPCMessage received error for message: Connection invalid
          Aug  4 15:31:23 Spam mediaserverd[22] <Notice>: '' com.appc.SamusTheBold(pid = 1079) setting DiscoveryMode = DiscoveryMode_None, currentDiscoveryMode = DiscoveryMode_None
          Aug  4 15:31:23 Spam com.apple.xpc.launchd[1] (UIKitApplication:com.appc.SamusTheBold[0xbad1][1079]) <Notice>: Service exited due to signal: Segmentation fault: 11
          Aug  4 15:31:23 Spam SpringBoard[53] <Warning>: [MPUSystemMediaControls] Updating supported commands for now playing application.
          Aug  4 15:31:23 Spam SpringBoard[53] <Warning>: [MPUSystemMediaControls] Updating supported commands for now playing application.
          Aug  4 15:31:23 Spam mediaserverd[22] <Notice>: 'FigPlayer - 29' (pid = 29) setting DiscoveryMode = DiscoveryMode_None, currentDiscoveryMode = DiscoveryMode_None
          Aug  4 15:31:23 Spam ReportCrash[1080] <Notice>: Saved report to /var/mobile/Library/Logs/CrashReporter/SamusTheBold_2016-08-04-153123_Spam.ips
          Aug  4 15:31:23 Spam SpringBoard[53] <Warning>: Application 'UIKitApplication:com.appc.SamusTheBold[0xbad1]' crashed.
          Aug  4 15:31:23 Spam assertiond[63] <Warning>: pid_suspend failed for <BKNewProcess: 0x154e16170; com.appc.SamusTheBold; pid: 1079; hostpid: -1>: Unknown error: -1, Unknown error: -1
          Aug  4 15:31:23 Spam assertiond[63] <Warning>: Could not set priority of <BKNewProcess: 0x154e16170; com.appc.SamusTheBold; pid: 1079; hostpid: -1> to 2, priority: No such process
          Aug  4 15:31:23 Spam assertiond[63] <Warning>: Could not set priority of <BKNewProcess: 0x154e16170; com.appc.SamusTheBold; pid: 1079; hostpid: -1> to 4096, priority: No such process
          Aug  4 15:31:23 Spam SpringBoard[53] <Warning>: Unable to deliver -[UIRemoteApplication showTopMostMiniAlertWithSynchronizationPort:] message to port 0: (ipc/send) invalid destination port
          Aug  4 15:31:23 Spam sharingd[59] <Notice>: 15:31:23.896 : Stopping Handoff scanning
          

          Handing off from iOS8Device to iOS9Device:
          iOS8Device: Activity moved to a different device.
          iOS9Device: continueactivity was fired.

          Tested On:
          iPhone 6S (9.3.3) Device & iPhone 6 Plus (8.3) Device
          Mac OSX El Capitan 10.11.6
          Ti SDK: 5.4.0.v20160802165655
          Appc Studio: 4.7.0.201607250649
          Appc NPM: 4.2.7
          App CLI: 5.4.0-37
          Xcode 7.3
          Node v4.4.7

          Show
          htbryant Harry Bryant added a comment - - edited Tested the fix with the demo code provided by Hans Knöchel and found an issue. Handing off from iOS9Device1 to iOS9Device2 : iOS9Device1: Activity moved to a different device. iOS9Device2: continueactivity was fired. Logs: [ERROR] : UIAlertController is up and showing an alert. ABORTING showing of modal controller Handing off from iOS9Device to iOS8Device : iOS9Device: Activity moved to a different device. iOS8Device: App crashes. Xcode Logs: Aug 4 15 : 31 : 23 Spam kernel[ 0 ] <Notice>: xpcproxy[ 1079 ] Container: / private /var/mobile/Containers/Data/Application/326B7AB3-16DB-4C33-94A6-B8BC41EF6A71 (sandbox) Aug 4 15 : 31 : 23 Spam SamusTheBold[ 1079 ] <Warning>: SOASTA TouchTest Build : 8244.160 Aug 4 15 : 31 : 23 Spam SamusTheBold[ 1079 ] <Warning>: SOASTA TouchTest initializing... Aug 4 15 : 31 : 23 Spam locationd[ 60 ] <Notice>: Gesture EnabledForTopCLient: 0 , EnabledInDaemonSettings: 0 Aug 4 15 : 31 : 23 Spam SamusTheBold[ 1079 ] <Warning>: Process delegate TiApp(o) : TiHost : NSObject Aug 4 15 : 31 : 23 Spam SamusTheBold[ 1079 ] <Warning>: added ctDidFinishLaunchingWithOptions Aug 4 15 : 31 : 23 Spam SamusTheBold[ 1079 ] <Warning>: watching application:didFinishLaunchingWithOptions: : success Aug 4 15 : 31 : 23 Spam SamusTheBold[ 1079 ] <Warning>: added ctOpenURL Aug 4 15 : 31 : 23 Spam SamusTheBold[ 1079 ] <Warning>: watching openURL : success Aug 4 15 : 31 : 23 Spam SamusTheBold[ 1079 ] <Warning>: SOASTA TouchTest initialized in 103 msec (# 51 ) Aug 4 15 : 31 : 23 Spam SamusTheBold[ 1079 ] <Error>: assertion failed: 12D508: libxpc.dylib + 71792 [3C982BC2-5B46-305A-9A09-3C3D15332820]: 0x7d Aug 4 15 : 31 : 23 Spam Unknown[ 1079 ] <Error>: Aug 4 15 : 31 : 23 Spam SamusTheBold[ 1079 ] <Warning>: [DEBUG] Reading stylesheet from: / private /var/mobile/Containers/Bundle/Application/9A54667A- 1524 - 4020 -B04D-7E23BBB19F46/SamusTheBold.app/stylesheet.plist Aug 4 15 : 31 : 23 Spam SamusTheBold[ 1079 ] <Warning>: [INFO] SamusTheBold/ 1.0 ( 5.4 . 0 .16921ce) Aug 4 15 : 31 : 23 Spam sharingd[ 59 ] <Notice>: 15 : 31 : 23.340 : Requesting Handoff payload Aug 4 15 : 31 : 23 Spam sharingd[ 59 ] <Notice>: 15 : 31 : 23.643 : Received a new Handoff advertisement from "SAMWISE" Aug 4 15 : 31 : 23 Spam sharingd[ 59 ] <Warning>: [Warning] No delegate was registered that could handle protobuf BC060AC5-021F-4A2D-883F-5FDA9A177137 Aug 4 15 : 31 : 23 Spam sharingd[ 59 ] <Warning>: [Warning] No delegate was registered that could handle protobuf BC060AC5-021F-4A2D-883F-5FDA9A177137 Aug 4 15 : 31 : 23 Spam sharingd[ 59 ] <Notice>: 15 : 31 : 23.719 : Received requested Handoff payload from "SAMWISE" (( null )) Aug 4 15 : 31 : 23 Spam ReportCrash[ 1080 ] <Error>: task_set_exception_ports(B07, 400 , D03, 0 , 0 ) failed with error ( 4 : (os/kern) invalid argument) Aug 4 15 : 31 : 23 Spam ReportCrash[ 1080 ] <Notice>: ReportCrash acting against PID 1079 Aug 4 15 : 31 : 23 Spam ReportCrash[ 1080 ] <Notice>: Formulating crash report for process SamusTheBold[ 1079 ] Aug 4 15 : 31 : 23 Spam SpringBoard[ 53 ] <Warning>: BSXPCMessage received error for message: Connection invalid Aug 4 15 : 31 : 23 Spam mediaserverd[ 22 ] <Notice>: '' com.appc.SamusTheBold(pid = 1079 ) setting DiscoveryMode = DiscoveryMode_None, currentDiscoveryMode = DiscoveryMode_None Aug 4 15 : 31 : 23 Spam com.apple.xpc.launchd[ 1 ] (UIKitApplication:com.appc.SamusTheBold[ 0xbad1 ][ 1079 ]) <Notice>: Service exited due to signal: Segmentation fault: 11 Aug 4 15 : 31 : 23 Spam SpringBoard[ 53 ] <Warning>: [MPUSystemMediaControls] Updating supported commands for now playing application. Aug 4 15 : 31 : 23 Spam SpringBoard[ 53 ] <Warning>: [MPUSystemMediaControls] Updating supported commands for now playing application. Aug 4 15 : 31 : 23 Spam mediaserverd[ 22 ] <Notice>: 'FigPlayer - 29' (pid = 29 ) setting DiscoveryMode = DiscoveryMode_None, currentDiscoveryMode = DiscoveryMode_None Aug 4 15 : 31 : 23 Spam ReportCrash[ 1080 ] <Notice>: Saved report to /var/mobile/Library/Logs/CrashReporter/SamusTheBold_2016- 08 - 04 -153123_Spam.ips Aug 4 15 : 31 : 23 Spam SpringBoard[ 53 ] <Warning>: Application 'UIKitApplication:com.appc.SamusTheBold[0xbad1]' crashed. Aug 4 15 : 31 : 23 Spam assertiond[ 63 ] <Warning>: pid_suspend failed for <BKNewProcess: 0x154e16170 ; com.appc.SamusTheBold; pid: 1079 ; hostpid: - 1 >: Unknown error: - 1 , Unknown error: - 1 Aug 4 15 : 31 : 23 Spam assertiond[ 63 ] <Warning>: Could not set priority of <BKNewProcess: 0x154e16170 ; com.appc.SamusTheBold; pid: 1079 ; hostpid: - 1 > to 2 , priority: No such process Aug 4 15 : 31 : 23 Spam assertiond[ 63 ] <Warning>: Could not set priority of <BKNewProcess: 0x154e16170 ; com.appc.SamusTheBold; pid: 1079 ; hostpid: - 1 > to 4096 , priority: No such process Aug 4 15 : 31 : 23 Spam SpringBoard[ 53 ] <Warning>: Unable to deliver -[UIRemoteApplication showTopMostMiniAlertWithSynchronizationPort:] message to port 0 : (ipc/send) invalid destination port Aug 4 15 : 31 : 23 Spam sharingd[ 59 ] <Notice>: 15 : 31 : 23.896 : Stopping Handoff scanning Handing off from iOS8Device to iOS9Device : iOS8Device: Activity moved to a different device. iOS9Device: continueactivity was fired. Tested On: iPhone 6S (9.3.3) Device & iPhone 6 Plus (8.3) Device Mac OSX El Capitan 10.11.6 Ti SDK: 5.4.0.v20160802165655 Appc Studio: 4.7.0.201607250649 Appc NPM: 4.2.7 App CLI: 5.4.0-37 Xcode 7.3 Node v4.4.7
          Hide
          cng Chee Kiat Ng (Inactive) added a comment -

          For reference. https://jira.appcelerator.org/browse/TIMOB-19567
          indicates that iOS9 device to iOS8 device did used to work. Just not sure if the regression was caused by this ticket.

          Show
          cng Chee Kiat Ng (Inactive) added a comment - For reference. https://jira.appcelerator.org/browse/TIMOB-19567 indicates that iOS9 device to iOS8 device did used to work. Just not sure if the regression was caused by this ticket.
          Hide
          hansknoechel Hans Knöchel added a comment -

          So, the "error" UIAlertController is up and showing an alert. ABORTING showing of modal controller is only shown, because an alert was already presented so the next one was aborted in the queue automatically. Why it doesn't work from iOS 9 to iOS 8 but from iOS 8 to iOS 9: Sick! I would love to have more logs on that, so I can debug it in Xcode. Thanks man!

          Show
          hansknoechel Hans Knöchel added a comment - So, the "error" UIAlertController is up and showing an alert. ABORTING showing of modal controller is only shown, because an alert was already presented so the next one was aborted in the queue automatically. Why it doesn't work from iOS 9 to iOS 8 but from iOS 8 to iOS 9: Sick! I would love to have more logs on that, so I can debug it in Xcode. Thanks man!
          Hide
          htbryant Harry Bryant added a comment - - edited

          Hans Knöchel in regards to the app crash from iOS9 to iOS8, no error logs are returned in the studio console, so what I provided above was the iOS8 device's logs from Xcode.

          Edit: Ran the app through CLI with DEBUG=*, here is the complete log of the iOS8 device when attempting to handoff from iOS9:

          [INFO]  SOASTA TouchTest Build : 8244.160
          [INFO]  SOASTA TouchTest initializing...
          [INFO]  Process delegate TiApp(o) : TiHost : NSObject
          [INFO]    added ctDidFinishLaunchingWithOptions
          [INFO]    watching application:didFinishLaunchingWithOptions: : success
          [INFO]    added ctOpenURL
          [INFO]    watching openURL : success
          [INFO]  SOASTA TouchTest initialized in 92 msec (#51)
          [INFO]  assertion failed: 12D508: libxpc.dylib + 71792 [3C982BC2-5B46-305A-9A09-3C3D15332820]: 0x7d
          [DEBUG] Reading stylesheet from: /private/var/mobile/Containers/Bundle/Application/6BE24824-4B19-4501-9105-C2AAD2348AE0/SamusTheBold.app/stylesheet.plist
          [INFO]  SamusTheBold/1.0 (5.4.0.16921ce)
          

          There doesn't seem to be any explicit errors here (also seen in Studio logs), but it may help you diagnose the problem.

          Show
          htbryant Harry Bryant added a comment - - edited Hans Knöchel in regards to the app crash from iOS9 to iOS8, no error logs are returned in the studio console, so what I provided above was the iOS8 device's logs from Xcode. Edit: Ran the app through CLI with DEBUG=*, here is the complete log of the iOS8 device when attempting to handoff from iOS9: [INFO] SOASTA TouchTest Build : 8244.160 [INFO] SOASTA TouchTest initializing... [INFO] Process delegate TiApp(o) : TiHost : NSObject [INFO] added ctDidFinishLaunchingWithOptions [INFO] watching application:didFinishLaunchingWithOptions: : success [INFO] added ctOpenURL [INFO] watching openURL : success [INFO] SOASTA TouchTest initialized in 92 msec (# 51 ) [INFO] assertion failed: 12D508: libxpc.dylib + 71792 [3C982BC2-5B46-305A-9A09-3C3D15332820]: 0x7d [DEBUG] Reading stylesheet from: / private /var/mobile/Containers/Bundle/Application/6BE24824-4B19- 4501 - 9105 -C2AAD2348AE0/SamusTheBold.app/stylesheet.plist [INFO] SamusTheBold/ 1.0 ( 5.4 . 0 .16921ce) There doesn't seem to be any explicit errors here (also seen in Studio logs), but it may help you diagnose the problem.
          Hide
          htbryant Harry Bryant added a comment -

          Verifying this ticket as fixed, as the original issue in question has been resolved. In regards to the comments reporting the issues with handing off a titanium app from iOS9 to iOS8, a separate ticket has been created (https://jira.appcelerator.org/browse/TIMOB-23747).

          Tested On:
          iPhone 6S (9.3.3) Device & iPhone 6 Plus (8.3) Device
          Mac OSX El Capitan 10.11.6
          Ti SDK: 5.4.0.v20160804185318
          Appc Studio: 4.7.0.201607250649
          Appc NPM: 4.2.7
          App CLI: 5.4.0-40
          Xcode 7.3.1
          Node v4.4.7

          Closing ticket.

          Show
          htbryant Harry Bryant added a comment - Verifying this ticket as fixed, as the original issue in question has been resolved. In regards to the comments reporting the issues with handing off a titanium app from iOS9 to iOS8, a separate ticket has been created ( https://jira.appcelerator.org/browse/TIMOB-23747 ). Tested On: iPhone 6S (9.3.3) Device & iPhone 6 Plus (8.3) Device Mac OSX El Capitan 10.11.6 Ti SDK: 5.4.0.v20160804185318 Appc Studio: 4.7.0.201607250649 Appc NPM: 4.2.7 App CLI: 5.4.0-40 Xcode 7.3.1 Node v4.4.7 Closing ticket.

            People

            • Assignee:
              hansknoechel Hans Knöchel
              Reporter:
              rramirez Ricardo Ramirez
              Reviewer:
              Angel Petkov
              Tester:
              Harry Bryant
            • Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development

                  Agile

                    Poker Sessions

                    This issue is currently not assigned to any Poker Session.

                      Git Source Code