Canvas+ broken communication with plugin


#1
  • Cocoon Version:
    2.1.0

  • Basic description of the problem:
    When I use local notifications plugin, the notification object is not received by plugin with same values as it is sent from Cocoon. Because of this, notifications don’t arrive at correct time. There is no such problem with Webview, only Canvas+.

Example of wrong data:
at: 123456789 is received as at: 123457
at: 1023456789 is received as at: 1023460
at: 1530878173223 is received as at: 1530880000
color: null is received as color: "null"

As you can see, the time property at gets rounded to 6 places, and few zeros are added to the end.

The color property is from different notification plugin, but it’s value is sent as null from Cocoon, and is received as "null" string by the plugin. This causes crash because null check is skipped. As stated before, this only happens with Canvas+ engine, not Webview.

  • Device info:
    Any

  • Steps will reproduce the problem:

  1. Install Local Notifications plugin in Cocoon cloud, set engine to Canvas+.
  2. Compile official notification demo from GitHub.
  3. Hook device to debugger console.
  4. Trigger the notification, and check results.
  • Expected result:
    JSON properties received by plugin should have the same values as object properties sent from Javascript application compiled using Cocoon Canvas+.

  • Webview engine(s):
    Canvas+

  • Used plugins (if relevant):
    Local Notifications


About New Cocoon Update