Start a new topic

setUseInjectedLocation() not working in iOS JS API

Hi,

I am using Wikitude SDK iOS JavaScript API  (version: 7.2.1 ) with Swift 3 and wanted to provide fixed location but this setUseInjectedLocation() method doesnt seem to work!

I am trying to set it to true in startWikitudeSDKRendering() as well as inside didFinishLoadArchitectWorldNavigation. 

Code snippet:


self.architectView?.setUseInjectedLocation(true);

 let location:CLLocationCoordinate2D = CLLocationCoordinate2D(latitude: Double(("12" as NSString).doubleValue), longitude: Double(("77" as NSString).doubleValue));

 if (self.architectView?.isUsingInjectedLocation())! 

{

 

 self.architectView?.injectLocation(withLatitude: location.latitude, longitude: location.longitude, altitude: 900, accuracy: 1);

 }


It never goes inside the if block!



I saw a similar post at - https://support.wikitude.com/support/discussions/topics/5000075538 but that also is not helpful.



1 person has this problem
1 Comment

Any help on this please, is there a bug in the SDK or need to implement it in a different way ?


Also, I tried a workaround to pass the coordinate directly in a custom JavaScript function using architectView?.callJavaScript( "xyz" ) to set the user location but that also doesn't work and the user location in AR view doesnt change to given location. Its still showing the POIs as per the location from GPS ( have disabled the user location updates inside locationChanged: function locationChangedFn(lat, lon, alt, acc) { } in the nativedetailscreen.js )  .


I am using Swift 3 and testing on iOS 9.


Thanks 



Login or Signup to post a comment