Start a new topic

passing data from .ts to POI

Hello
i work in a project with ionic 3 and wikitude POI it's work fine but i like to passing data from my class (ionic) to index POI 


2 people have this problem

Hi Abdelkader,

Are you looking for ways to request and work with POI detail information in your ARchitect Worlds? Then please refer to the documentation section here https://www.wikitude.com/external/doc/documentation/latest/android/retrievingpoidata.html#retrieving-poi-data.

Thanks
Eva

 

thank you Eva for replying me but my problem is i have a ionic page when i call wikitudePlugin and i pass some configuration 

 

 ionViewDidEnter() {
    var startupConfiguration: any = { camera_position: "back" };
    // console.log("ionViewDidEnter", WikitudePlugin);
    WikitudePlugin.loadARchitectWorld(
      function(success) {
        console.log("Success to load ARchitect World!", success);
      },
      function(fail) {
        console.log("Failed to load ARchitect World!", fail);
      },
      //          "www/assets/3_3dModels_1_3dModelOnTarget/index.html", // (1) if you have a IR (Image Recognition) World, use this
      //          ["ir"], // (1) if you have a IR (Image Recognition) World, use this
      "www/assets/08_PointOfInterest_3_MultiplePois/index.html", // (2) if you have a GeoLocation World, use this
      ["geo"], // (2) if you have a GeoLocation World, use this
      // you find other samples or Wikitude worlds in Wikitude Cordova Plugin
      // which can be downloaded from here: https://github.com/Wikitude/wikitude-cordova-plugin/archive/v5.3.1-3.3.2.zip
      <JSON>startupConfiguration
    );
  }

and i like to passing a data when i call the plugin without passing with Server 

Good morning,



I believe what you are looking for is the callJavaScript function.


Calling that allows you to execute JavaScript code in your ARchitect world.

  

WikitudePlugin.callJavaScript("World.myJSFunction();");

  


- Daniel

i dont know where can i put it 
WikitudePlugin variable is defined in my ionic page when i try to called under the index of POI i got undefined   

Hi,



your code snippet shows a call to WikitudePlugin.loadARchitectWorld, does that work for you, or is that malfunctioning already?




- Daniel

Hi
 
yep  i have create a ionic page and in page.ts (logique of page) i called a Wikitude Interface with loadARchitectWorld  and when my code is executed i wikitude create me a new WebView with file Required in LoadArchitect "www/assets/08_PointOfInterest_3_MultiplePois/index.html
but when i try to close it or create a back button or passing a data between my ionic app i  have to call  WikitudePlugin    in the index of POI  i have some error js  and when i try to debug the wikitudePlugin variable i have undefined  


PS :
i have followed this example to integrate wikitude with ionic 
https://market.ionicframework.com/starters/wikitude-ionic-2-starter-app

Hello abdelkader, did you resolve this issue ? because im in the same issue .. thank you

Hi all,


I'm afraid that Wikitude cannot provide any assistance for Ionic. Not only because we don't provide official support for it, but, more practically, because we (as in all of the SDK developers) do not have any Ionic knowledge or experience. The Ionic extension was developed independently by a third party and we simply provide a download link for it.

You could, if this issue is still current, try to reproduce it in our sample app which we provide a generation script for. So the setup process should not be very time consuming.


Thank you for understanding

Wikitude Support Team

I found a solution in case someone is having the same issue.


If you want to call some functions from your ionic .ts file to your POI .js file, define a function in your AR World :


  takeAction: function takeActionFn(action) {

    document.location = 'architectsdk://button?action=' + action;

  }


and your Ionic app listen :


WikitudePlugin.setOnUrlInvokeCallback((url) => {

  if (url.indexOf('action=close') > -1) WikitudePlugin.close();

});


Replace close with any function defined in your .ts file.


hope this help.



I want to set pois at specific locations in my building, how to achieve it irrespective of my current location

Login or Signup to post a comment