Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.3 Final
    • Fix Version/s: None
    • Component/s: BridgeIt
    • Labels:
      None
    • Environment:
      BridgeIt/ICEmobile-SX, jQuery Mobile or other 3rd party JavaScript

      Description

      The current BridgeIt response makes use of nested url-encoded parameters. This is fairly efficient but is somewhat complex and recent integration with jQuery Mobile showed conflicts due to the fact that parts of the response are parsed by jQuery Mobile. To prevent this, the url-encoded data can now be wrapped in a base64 encoding. This reduces efficiency and slightly increases the complexity of the implementation.

      Since the base64 variant is necessary in some cases, the most straightforward approach would be to use it in all cases and work with a simplified underlying payload that relies on base64. This means that a binary format can be used.

        Activity

        Hide
        Ted Goddard added a comment -

        iOS support added for scan result in json64 format

        event.value.data containing the scanned value

        Potentially event.value.type = "PDF417" or other could be added as scan metadata.

        (However, it's possible that event.value should remain as the string value of the scan and other metadata should be added to the event.)

        Show
        Ted Goddard added a comment - iOS support added for scan result in json64 format event.value.data containing the scanned value Potentially event.value.type = "PDF417" or other could be added as scan metadata. (However, it's possible that event.value should remain as the string value of the scan and other metadata should be added to the event.)
        Hide
        Ted Goddard added a comment -

        Sample command for fetchContact on iOS. Parameters that are associated with the operation of the BridgeIt data exchange itself or are common to many commands start with "_":

        { "_callback" = onAfterReturnFromContacts; "_command" = fetchContacts; "_id" = contactListBtn; "_restoreHash" = ""; "_returnURL" = "http://seven.local:4000/contacts64.html#bridgeit"; "_seq" = 1390951221186; "_urlBase" = "http://seven.local:4000/"; "_version" = "1.0.4"; fields = "name,email,phone"; }
        Show
        Ted Goddard added a comment - Sample command for fetchContact on iOS. Parameters that are associated with the operation of the BridgeIt data exchange itself or are common to many commands start with "_": { "_callback" = onAfterReturnFromContacts; "_command" = fetchContacts; "_id" = contactListBtn; "_restoreHash" = ""; "_returnURL" = "http://seven.local:4000/contacts64.html#bridgeit"; "_seq" = 1390951221186; "_urlBase" = "http://seven.local:4000/"; "_version" = "1.0.4"; fields = "name,email,phone"; }
        Hide
        Ted Goddard added a comment -

        Sample BridgeIt AR command to test large payload:

        eyJsb2NhdGlvbnMiOlt7Im5hbWUiOiJNZXJjdXJ5IiwiZXFjb29yZHMiOlsyMS44MTY3NjQ3ODk1ODE0MiwiLTEzLjkiXSwiaWNvbiI6ImltYWdlcy9tZXJjdXJ5LnBuZyJ9LHsibmFtZSI6IlZlbnVzIiwiZXFjb29yZHMiOlsxOC44ODYyNTA4MDk1ODkzODgsIi0xNS45Il0sImljb24iOiJpbWFnZXMvdmVudXMucG5nIn0seyJuYW1lIjoiTWFycyIsImVxY29vcmRzIjpbMTMuMzk2MDQ5NjYzNjA0MDE0LCItMDYuMSJdLCJpY29uIjoiaW1hZ2VzL21hcnMucG5nIn0seyJuYW1lIjoiSnVwaXRlciIsImVxY29vcmRzIjpbNi45MTQ5OTI0MDAzNzcwNzMsIisyMyJdLCJpY29uIjoiaW1hZ2VzL2p1cGl0ZXIucG5nIn0seyJuYW1lIjoiU2F0dXJuIiwiZXFjb29yZHMiOlsxNS4zNDkwOTk5ODEzNDI3MjcsIi0xNi4xIl0sImljb24iOiJpbWFnZXMvc2F0dXJuLnBuZyJ9LHsibmFtZSI6IlVyYW51cyIsImVxY29vcmRzIjpbMC41NzA4Njk2OTgyMTE4NzQ1LCIrMDMiXSwiaWNvbiI6ImltYWdlcy91cmFudXMucG5nIn0seyJuYW1lIjoiTmVwdHVuZSIsImVxY29vcmRzIjpbMjIuMzk2NTc5MTcwMjc3NTcsIi0xMC43Il0sImljb24iOiJpbWFnZXMvbmVwdHVuZS5wbmcifSx7Im5hbWUiOiJQbHV0byIsImVxY29vcmRzIjpbMTguODQ4NzgxMzExNjQ1NzIzLCItMjAuMiJdLCJpY29uIjoiaW1hZ2VzL3BsdXRvLnBuZyJ9LHsibmFtZSI6IlN1biIsImVxY29vcmRzIjpbMjAuNjQ4MjEwODE1NjE4Mzk1LCItMTguNCJdLCJpY29uIjoiaW1hZ2VzL3N1bi5wbmcifSx7Im5hbWUiOiJNb29uIiwiZXFjb29yZHMiOlsxNy42MTY0NjQ3OTM2NTkxMTIsIi0yMCJdLCJpY29uIjoiaW1hZ2VzL21vb24ucG5nIn1dLCJfY2FsbGJhY2siOiJvblJldHVybkZyb21BdWdtZW50ZWRSZWFsaXR5IiwiX3ZlcnNpb24iOiIxLjAuMyIsIl9wb3N0VVJMIjoiaHR0cDovL2FwaS5icmlkZ2VpdC5tb2JpL2VjaG8vYmxvYiIsIl9jb21tYW5kIjoiYXVnIiwiX2lkIjoiX3NvbGFyIiwiX3NlcSI6MTM5MDg0NzA2NTk0OSwiX3JldHVyblVSTCI6Imh0dHA6Ly9vcmQubG9jYWw6NDAwMC9zb2xhcjY0Lmh0bWwjYnJpZGdlaXQiLCJfcmVzdG9yZUhhc2giOiIifQ~~

        contains the command:

        {"locations":[

        {"name":"Mercury","eqcoords":[21.81676478958142,"-13.9"],"icon":"images/mercury.png"}

        ,

        {"name":"Venus","eqcoords":[18.886250809589388,"-15.9"],"icon":"images/venus.png"}

        ,

        {"name":"Mars","eqcoords":[13.396049663604014,"-06.1"],"icon":"images/mars.png"}

        ,

        {"name":"Jupiter","eqcoords":[6.914992400377073,"+23"],"icon":"images/jupiter.png"}

        ,

        {"name":"Saturn","eqcoords":[15.349099981342727,"-16.1"],"icon":"images/saturn.png"}

        ,

        {"name":"Uranus","eqcoords":[0.5708696982118745,"+03"],"icon":"images/uranus.png"}

        ,

        {"name":"Neptune","eqcoords":[22.39657917027757,"-10.7"],"icon":"images/neptune.png"}

        ,

        {"name":"Pluto","eqcoords":[18.848781311645723,"-20.2"],"icon":"images/pluto.png"}

        ,

        {"name":"Sun","eqcoords":[20.648210815618395,"-18.4"],"icon":"images/sun.png"}

        ,

        {"name":"Moon","eqcoords":[17.616464793659112,"-20"],"icon":"images/moon.png"}

        ],"_callback":"onReturnFromAugmentedReality","_version":"1.0.3","_postURL":"http://api.bridgeit.mobi/echo/blob","_command":"aug","_id":"_solar","_seq":1390847065949,"_returnURL":"http://ord.local:4000/solar64.html#bridgeit","_restoreHash":""}

        These are 1448 and 1084 bytes respectively.

        Show
        Ted Goddard added a comment - Sample BridgeIt AR command to test large payload: eyJsb2NhdGlvbnMiOlt7Im5hbWUiOiJNZXJjdXJ5IiwiZXFjb29yZHMiOlsyMS44MTY3NjQ3ODk1ODE0MiwiLTEzLjkiXSwiaWNvbiI6ImltYWdlcy9tZXJjdXJ5LnBuZyJ9LHsibmFtZSI6IlZlbnVzIiwiZXFjb29yZHMiOlsxOC44ODYyNTA4MDk1ODkzODgsIi0xNS45Il0sImljb24iOiJpbWFnZXMvdmVudXMucG5nIn0seyJuYW1lIjoiTWFycyIsImVxY29vcmRzIjpbMTMuMzk2MDQ5NjYzNjA0MDE0LCItMDYuMSJdLCJpY29uIjoiaW1hZ2VzL21hcnMucG5nIn0seyJuYW1lIjoiSnVwaXRlciIsImVxY29vcmRzIjpbNi45MTQ5OTI0MDAzNzcwNzMsIisyMyJdLCJpY29uIjoiaW1hZ2VzL2p1cGl0ZXIucG5nIn0seyJuYW1lIjoiU2F0dXJuIiwiZXFjb29yZHMiOlsxNS4zNDkwOTk5ODEzNDI3MjcsIi0xNi4xIl0sImljb24iOiJpbWFnZXMvc2F0dXJuLnBuZyJ9LHsibmFtZSI6IlVyYW51cyIsImVxY29vcmRzIjpbMC41NzA4Njk2OTgyMTE4NzQ1LCIrMDMiXSwiaWNvbiI6ImltYWdlcy91cmFudXMucG5nIn0seyJuYW1lIjoiTmVwdHVuZSIsImVxY29vcmRzIjpbMjIuMzk2NTc5MTcwMjc3NTcsIi0xMC43Il0sImljb24iOiJpbWFnZXMvbmVwdHVuZS5wbmcifSx7Im5hbWUiOiJQbHV0byIsImVxY29vcmRzIjpbMTguODQ4NzgxMzExNjQ1NzIzLCItMjAuMiJdLCJpY29uIjoiaW1hZ2VzL3BsdXRvLnBuZyJ9LHsibmFtZSI6IlN1biIsImVxY29vcmRzIjpbMjAuNjQ4MjEwODE1NjE4Mzk1LCItMTguNCJdLCJpY29uIjoiaW1hZ2VzL3N1bi5wbmcifSx7Im5hbWUiOiJNb29uIiwiZXFjb29yZHMiOlsxNy42MTY0NjQ3OTM2NTkxMTIsIi0yMCJdLCJpY29uIjoiaW1hZ2VzL21vb24ucG5nIn1dLCJfY2FsbGJhY2siOiJvblJldHVybkZyb21BdWdtZW50ZWRSZWFsaXR5IiwiX3ZlcnNpb24iOiIxLjAuMyIsIl9wb3N0VVJMIjoiaHR0cDovL2FwaS5icmlkZ2VpdC5tb2JpL2VjaG8vYmxvYiIsIl9jb21tYW5kIjoiYXVnIiwiX2lkIjoiX3NvbGFyIiwiX3NlcSI6MTM5MDg0NzA2NTk0OSwiX3JldHVyblVSTCI6Imh0dHA6Ly9vcmQubG9jYWw6NDAwMC9zb2xhcjY0Lmh0bWwjYnJpZGdlaXQiLCJfcmVzdG9yZUhhc2giOiIifQ~~ contains the command: {"locations":[ {"name":"Mercury","eqcoords":[21.81676478958142,"-13.9"],"icon":"images/mercury.png"} , {"name":"Venus","eqcoords":[18.886250809589388,"-15.9"],"icon":"images/venus.png"} , {"name":"Mars","eqcoords":[13.396049663604014,"-06.1"],"icon":"images/mars.png"} , {"name":"Jupiter","eqcoords":[6.914992400377073,"+23"],"icon":"images/jupiter.png"} , {"name":"Saturn","eqcoords":[15.349099981342727,"-16.1"],"icon":"images/saturn.png"} , {"name":"Uranus","eqcoords":[0.5708696982118745,"+03"],"icon":"images/uranus.png"} , {"name":"Neptune","eqcoords":[22.39657917027757,"-10.7"],"icon":"images/neptune.png"} , {"name":"Pluto","eqcoords":[18.848781311645723,"-20.2"],"icon":"images/pluto.png"} , {"name":"Sun","eqcoords":[20.648210815618395,"-18.4"],"icon":"images/sun.png"} , {"name":"Moon","eqcoords":[17.616464793659112,"-20"],"icon":"images/moon.png"} ],"_callback":"onReturnFromAugmentedReality","_version":"1.0.3","_postURL":"http://api.bridgeit.mobi/echo/blob","_command":"aug","_id":"_solar","_seq":1390847065949,"_returnURL":"http://ord.local:4000/solar64.html#bridgeit","_restoreHash":""} These are 1448 and 1084 bytes respectively.
        Hide
        Ted Goddard added a comment -

        An alternative to this is to simply use a JSON string encoded as base64. This is less efficient than the above scheme but has the advantage of being trivial to implement.

        This will be prototyped within bridgeit.js under the useJSON64 flag. For iOS, the new encoding will invoke BridgeIt.app via bridgeit: URL scheme.

        Show
        Ted Goddard added a comment - An alternative to this is to simply use a JSON string encoded as base64. This is less efficient than the above scheme but has the advantage of being trivial to implement. This will be prototyped within bridgeit.js under the useJSON64 flag. For iOS, the new encoding will invoke BridgeIt.app via bridgeit: URL scheme.
        Hide
        Ted Goddard added a comment -

        A simple name/value binary format will allow strings and images to be included directly in the payload via a sequence of:

        [name][null][int32 length][value]

        Nested values would not be directly supported (although a given value could be XML or JSON with no escaping) but the name would support a path /-separated structure that could be mapped directly onto a JavaScript object. A marker value would indicate that the associated value should be, say, encoded as base64 with a mime-type prefix.

        name = <binary data>
        name/_fix = "png64"

        Where a collection of named "fix" rules would be supported by BridgeIt. "png64" would encode the binary data as base64 and prepend with "data:image/png;base64,". Various rules could be defined for other data types.

        Show
        Ted Goddard added a comment - A simple name/value binary format will allow strings and images to be included directly in the payload via a sequence of: [name] [null] [int32 length] [value] Nested values would not be directly supported (although a given value could be XML or JSON with no escaping) but the name would support a path /-separated structure that could be mapped directly onto a JavaScript object. A marker value would indicate that the associated value should be, say, encoded as base64 with a mime-type prefix. name = <binary data> name/_fix = "png64" Where a collection of named "fix" rules would be supported by BridgeIt. "png64" would encode the binary data as base64 and prepend with "data:image/png;base64,". Various rules could be defined for other data types.

          People

          • Assignee:
            Ted Goddard
            Reporter:
            Ted Goddard
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: