{ "id": "150855", "key": "TIMOB-19441", "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": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2015-09-03T08:09:30.000+0000", "created": "2015-08-31T15:03:55.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "handoff" ], "versions": [ { "id": "16925", "description": "WatchKit Support--all going into 5.0 now", "name": "Release 5.0.0", "archived": true, "released": true, "releaseDate": "2015-09-16" } ], "issuelinks": [ { "id": "48880", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "150945", "key": "TIDOC-2298", "fields": { "summary": "App.iOS.UserActivity needsSave, useractivitywillsave and eligible* miss vital information", "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" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-20T21:42:36.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": "The [Ti 5.0 sample app|https://github.com/appcelerator-developer-relations/appc-sample-ti500] will show that the {{useractivitywillsave}} event only fires when you call {{becomeCurrent()}}. It does not fire before/when you continue the activity on another device, like the [docs|https://appcelerator.github.io/appc-docs/latest/#!/api/Titanium.App.iOS.UserActivity-property-needsSave] say it will when you set {{needSave}} to {{true}}. This leaves you with no way to update the activity before the other devices takes over.", "attachment": [], "flagged": false, "summary": "useractivitywillsave does not fire before continuing on other device", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "SDK 5.0.0.v20150829212027", "closedSprints": [ { "id": 481, "state": "closed", "name": "2015 Sprint 18 SDK", "startDate": "2015-08-29T00:30:25.440Z", "endDate": "2015-09-12T00:30:00.000Z", "completeDate": "2015-09-14T05:24:05.135Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "362051", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "I ran some tests that showed that {{useractivitywillsave}} will fire when:\r\n\r\n* You call {{becomeCurrent()}} on an activity.\r\n* Before the current activity is sent for continuation on another devices ([as Apple says|https://developer.apple.com/library/prerelease/ios/documentation/Foundation/Reference/NSUserActivity_Class/#//apple_ref/occ/instp/NSUserActivity/needsSave]) but *only* if since that activity became current you have made a change (updated {{userInfo}}) to it.\r\n\r\nThis is weird, since you'd expect the event would give you the chance to (only then) update the activity with e.g. the current text of the email you were composing. If you have to update the activity in order for the event to fire, then what is there left to do when it gets called?", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-09-02T09:39:10.000+0000", "updated": "2015-09-02T09:39:10.000+0000" }, { "id": "362052", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "From Apple's [Handoff Programming Guide: Best Practices|https://developer.apple.com/library/mac/documentation/UserExperience/Conceptual/Handoff/AdoptingHandoff/AdoptingHandoff.html#//apple_ref/doc/uid/TP40014338-CH2-SW14]:\r\n\r\n{quote}To update the activity object’s userInfo dictionary efficiently, configure its delegate and set its needsSave property to YES whenever the userInfo needs updating. At appropriate times, Handoff invokes the delegate’s userActivityWillSave: callback, and the delegate can update the activity state.{quote}\r\n\r\n[This StackOverflow answer|http://stackoverflow.com/a/26792196/4626813] has a sample that demonstrates this:\r\n\r\n{code}\r\n- (NSUserActivity *)customUserActivity \r\n{\r\n if (!_customUserActivity) {\r\n _customUserActivity = [[NSUserActivity alloc] initWithActivityType:@\"com.company.app.edit\"];\r\n _customUserActivity.title = @\"Editing in app\";\r\n _customUserActivity.delegate = self;\r\n }\r\n\r\n return _customUserActivity;\r\n}\r\n\r\n- (void)textViewDidBeginEditing:(UITextView *)textView \r\n{\r\n [self.customUserActivity becomeCurrent];\r\n}\r\n\r\n- (void)textViewDidChange:(UITextView *)textView \r\n{\r\n self.customUserActivity.needsSave = YES;\r\n}\r\n\r\n- (BOOL)textViewShouldEndEditing:(UITextView *)textView \r\n{\r\n [self.customUserActivity invalidate];\r\n\r\n return YES;\r\n}\r\n\r\n- (void)userActivityWillSave:(NSUserActivity *)userActivity \r\n{\r\n [userActivity addUserInfoEntriesFromDictionary:@{ @\"editText\" : self.textView.text }];\r\n}\r\n{code}\r\n\r\nSo it seems we (and Apple:)) should update our guide/reference to make clear that you need to call {{needsSave}} every time you have a change and then update the activity with the actual change when asked via the {{useractivitywillsave}} event.", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-09-02T09:49:21.000+0000", "updated": "2015-09-02T09:49:21.000+0000" }, { "id": "362157", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Thanks Fokke. closing as invalid and will open a tidoc ticket.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-09-03T08:09:03.000+0000", "updated": "2015-09-03T08:09:44.000+0000" }, { "id": "414001", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-20T21:42:36.000+0000", "updated": "2017-03-20T21:42:36.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }