Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19448] watchOS2 sendMessage fails on certain payloads

GitHub Issuen/a
TypeBug
PriorityNone
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterRick Blalock
AssigneeUnknown
Created2015-09-01T16:50:01.000+0000
Updated2018-02-28T19:55:11.000+0000

Description

I can consistently reproduce the below scenario: This works:
			Ti.WatchSession.sendMessage({
				foo: 'bar',
				time: (new Date()).toString()
			});
Swift delegate:
	func session(session: WCSession, didReceiveMessage message: [String : AnyObject]) {
		NSLog("%@", message)
        }
Output in console:
Sep  1 11:41:42 rblalockRMBP fishruleswatchapp WatchApp Extension[20076]: {
	    foo = bar;
	    time = "Tue Sep 01 2015 11:41:42 GMT-0400 (EDT)";
	}
THIS however does not work. The delegate never is invoked. It's due to the payload (which did work on the previous watch kit iteration).
Ti.WatchSession.sendMessage({
      regulation: regulation
});

// The data payload of regulation is this, as output from the Ti logs
[INFO]  (
[INFO]          {
[INFO]          "additional_licenses_required" = "";
[INFO]          "aggregate_created_at" = "2014-09-22 11:38:47";
[INFO]          "aggregate_id" = 5;
[INFO]          "aggregate_limit" = 3;
[INFO]          "aggregate_name" = Grouper;
[INFO]          "aggregate_updated_at" = "2014-09-22 11:38:47";
[INFO]          "bag_limit" = 1;
[INFO]          "created_at" = "2014-09-22 11:39:01";
[INFO]          "deleted_at" = "<null>";
[INFO]          effective = 0;
[INFO]          "effective_at" = "2014-09-22 11:39:01";
[INFO]          "effective_status" = "<null>";
[INFO]          "gear_created_at" = "2014-09-22 11:38:46";
[INFO]          "gear_description" = "Dehooking device use required as needed.";
[INFO]          "gear_id" = 1;
[INFO]          "gear_name" = Dehooking;
[INFO]          "gear_updated_at" = "2014-09-23 13:02:00";
[INFO]          gigging = 0;
[INFO]          "gigging_status" = Prohibited;
[INFO]          id = 539;
[INFO]          "location_area" = "fl_atlantic_state";
[INFO]          "location_created_at" = "2014-09-22 11:38:56";
[INFO]          "location_id" = 5;
[INFO]          "location_is_top_level" = 0;
[INFO]          "location_name" = "FL Atlantic State Waters";
[INFO]          "location_prohibited" = 0;
[INFO]          "location_prohibited_message" = "";
[INFO]          "location_rank" = 100;
[INFO]          "location_updated_at" = "2015-08-04 22:09:15";
[INFO]          "max_size" = "<null>";
[INFO]          "measurement_abbreviation" = TL;
[INFO]          "measurement_created_at" = "2014-09-22 11:38:47";
[INFO]          "measurement_description" = "Total length means the straight line distance from the most forward point of the head with the mouth closed, to the farthest tip of the tail with the tail compressed or squeezed, while the fish is lying on its side.";
[INFO]          "measurement_id" = 1;
[INFO]          "measurement_name" = "Total Length";
[INFO]          "measurement_unit" = in;
[INFO]          "measurement_unit_symbol" = "\"";
[INFO]          "measurement_updated_at" = "2014-09-22 11:38:47";
[INFO]          "min_size" = 24;
[INFO]          "multiple_hooks" = 0;
[INFO]          "multiple_hooks_status" = Prohibited;
[INFO]          notes = "Limit 1 Gag or Black Grouper";
[INFO]          "parent_id" = 539;
[INFO]          prohibited = 0;
[INFO]          "prohibited_status" = No;
[INFO]          published = 1;
[INFO]          "published_at" = "2014-09-22 11:39:01";
[INFO]          "published_status" = Published;
[INFO]          seasons = "[{\"id\":458,\"regulation_id\":539,\"starts_at\":{\"date\":\"2015-01-01 21:52:21.000000\",\"timezone_type\":3,\"timezone\":\"America\\/New_York\"},\"ends_at\":{\"date\":\"2015-04-30 21:52:21.000000\",\"timezone_type\":3,\"timezone\":\"America\\/New_York\"},\"created_at\":\"2015-05-11 21:52:19\",\"updated_at\":\"2015-05-11 21:52:19\"}]";
[INFO]          snagging = 0;
[INFO]          "snagging_status" = Prohibited;
[INFO]          spearing = 0;
[INFO]          "spears_status" = Prohibited;
[INFO]          "specie_created_at" = "2014-09-22 11:38:48";
[INFO]          "specie_edibility" = "Excellent, but large individuals may contain ciguatera toxin and elevated mercury levels.";
[INFO]          "specie_fish_id" = 202;
[INFO]          "specie_id" = 17;
[INFO]          "specie_name" = "Grouper, Gag";
[INFO]          "specie_shape_created_at" = "2014-09-22 11:38:48";
[INFO]          "specie_shape_id" = 7;
[INFO]          "specie_shape_name" = "Oblong Big Mouth";
[INFO]          "specie_shape_updated_at" = "2014-09-22 11:38:48";
[INFO]          "specie_synonyms" = "[]";
[INFO]          "specie_updated_at" = "2014-09-22 11:38:48";
[INFO]          "trophy_limit" = 0;
[INFO]          "trophy_size" = "<null>";
[INFO]          "updated_at" = "2015-05-11 21:52:21";
[INFO]          "user_id" = "<null>";
[INFO]          "vessel_limit" = "<null>";
[INFO]      }
[INFO]  )
Same delegate as above, and it's never invoked. There is also nothing in the console that indicates there was a problem. After playing around with it...if you have a null value it doesn't work. i.e. works
			Ti.WatchSession.sendMessage({
				regulation: {
					foo: "bar",
				}
			});
Doesn't work
			Ti.WatchSession.sendMessage({
				regulation: {
					foo: null,
				}
			});

Comments

No comments

JSON Source