6 Replies Latest reply on Apr 28, 2014 2:10 PM by Chris Child

    Getting 2.2 Modules to play with 4.0

    Chris Child

      I had asked a question a week ago about having issues getting the GeoLocation API to work on an MC9500 but did not get any responses. Through my own debugging I think I found that I need to get the 2.2 rho_javascript_api.js file to work with the new common API. Can someone point to somewhere that has information on how to accomplish this? I can see these comments below in the generated rho_javascript_api.js but with no instructions on if I need all of them, some of them or if I'm way off base and need none of them as well as the order in which they should be loaded.

       

      In case you need to use pre-4.0 JS API together with new Common JS API you can

          involve compatibility layer this way:

       

       

              <!-- required for pre-4.0 JS API -->

              <script type="text/javascript" src="/public/jquery/jquery-1.6.4.min.js"></script>

              <script type="text/javascript" src="/public/jquery/jquery.json-2.3.min.js"></script>

       

       

              <!-- pre-4.0 JS API -->

              <script type="text/javascript" src="/public/js/rho_javascript_api.js"></script>

       

       

              <!-- compatibility layer -->

              <script type="text/javascript" src="/public/js/rho_common_api_noconflict.js"></script>

       

       

              <!-- new Common JS API -->

              <script type="text/javascript" charset="utf-8" src="/public/api/rhoapi-modules.js"></script>

       

       

          NOTE: load order is important!

        • Re: Getting 2.2 Modules to play with 4.0
          Kutir Mobility

          Chris,

          You need all those scripts for the 2.2 API to work together with the new 4.0 Common API

          rho_javascript_api.js , rho_common_api_noconflict.js and rhoapi-modules.js will be provided for you automatically at build time

          jQuery does not need to be 1.6.4, you can update to 1.x

          jQuery-json is required

           

          The order of the scripts must be exactly as described :

          - jquery

          - jquery-json

          - rho_javascript_api.js

          - rho_common_api_noconflict.js

          - rhoapi-modules.js

           

          You also need to add the "json" extension to your build.yml file.


          Visnupriya R

          Kutir Mobility

            • Re: Getting 2.2 Modules to play with 4.0
              Chris Child

              You wouldn't happen to have an example or know of an example I can look at online do you? The only part of your instructions I was missing was adding "json" to my build.yml extensions and that hasn't fixed my issue.

               

              Thanks

               

              Chris

                • Re: Getting 2.2 Modules to play with 4.0
                  Kutir Mobility

                  Here is an example of a working configuration:

                   

                          <script src="/public/jquery/jquery-1.10.2.js"></script>

                          <script src="/public/jquery-json/jquery.json-2.3.js"></script>

                    

                          <script src="/public/js/rho_javascript_api.js"></script>

                          <script src="/public/js/rho_common_api_noconflict.js"></script>

                   

                          <script src="/public/api/rhoapi-modules.js"></script>

                   

                  and in build.yml:

                   

                  capabilities: ["gps"]

                  extensions: ["rho-javascript", "json"]

                   

                  This is known to work (I am using it in a real project)



                  Visnupriya R

                  Kutir Mobility

                    • Re: Getting 2.2 Modules to play with 4.0
                      Chris Child

                      I've got one more idea to try but can't until I get into work tomorrow. I'm going to put the motorola webkit into my build.yml since I'm using an MC9500 to see if that fixes it, as I vaguely remember reading something about it and Motorola devices. Everything else you've posted though is exactly how I have my project configured but it continues to fail on Rho.Geolocation.latitude()/longitude() saying it can't find Rho.Geolocation.latitude/longitude.

                       

                      Thank you for all the help so far!

                        • Re: Getting 2.2 Modules to play with 4.0

                          Chris,

                               Did you ever get this to work? If so, what did you have to do? I'd like to make sure we have exactly the correct details in our docs so that people in the future don't need to hunt around as long as you had to.

                            • Re: Getting 2.2 Modules to play with 4.0
                              Chris Child

                              Sorry for the late reply I've had my head down with our project. I was not able to get this working with the MC95 device we are currently using. I followed the replies I had gotten but I was continuing to get the same errors I had been getting from the start. I believe we are close to getting our license and my boss is wanting to speak with some representatives about this issue and a few others. If we get an answer out of there I will be sure to update this thread.

                               

                              Chris