I am running "example 5_BrowsingPois_5_NativeDetailScreen" and the "More" Button is doing anything (Wikitude 7.8.2 SDK 3.2 on Android 4.1.2 Samsung Galaxy S3)
About
// user clicked "More" button in POI-detail panel -> fire event to open native screen
onPoiDetailMoreButtonClicked: function onPoiDetailMoreButtonClickedFn() {
the architectSdkUrl is constructed fine but "document.location = architectSdkUrl" is not leading to architectSdkUrl.
Do you know why ?
BR,
Dimitrios
W
Wolfgang Damm
said
over 9 years ago
Have you modified the example in anyway, or is this occuring with our unmodified SDKSamples application?
If you have copied the example into your own application you will need to register the ArchtiectURLListener in Java. (see SampleCamHandlePoiDetailActivity). If your Activity extends our AbstractArchitectCamActivity it is as simple as overriding the getUrlListener() method.
If you do not extend from the AbstractArchitectCamActivity, just make sure to call
// register valid urlListener in architectView, ensure this // is set before content is loaded to not miss any event this.architectView.registerUrlListener( yourUrlListener );
C
Cora Reyes Calens
said
about 9 years ago
Hi, I'm facing the same problem with the "More" button to display the POI detail in a new Activity. I've copied the Wikitude code to mi own application. This is the only feature that's not working. I've looked at the sample code many times but can't figure this out. I've already overriden the getUrlListener() method.
Note that you have to register url listener inside the cam-experience to get notified. According your snippet you defined it inside the POI-Detail activity. Please have a look at the "SampleCamHandlePoiDetailActivity.java" in the SDK Samples app, which calls "SamplePoiDetailActivity" after user pressed "more"-button.
Hope that helps, Kind regards
C
Cora Reyes Calens
said
about 9 years ago
This is what I have so far (which is not working at the moment):
public class CameraHandleIssueDetailActivity extends CameraActivity{
public ArchitectUrlListener getUrlListener() { return new ArchitectUrlListener() {
@Override // fetch e.g. document.location = "architectsdk://markerselected?id=1"; public boolean urlWasInvoked(String uriString) { ...
} }; }
}
public class IssueDetailActivity extends Activity {
public static final String EXTRAS_KEY_POI_ID = "id"; public static final String EXTRAS_KEY_POI_TITILE = "title"; public static final String EXTRAS_KEY_POI_DESCR = "description";
Is this correct? Should I add the url listener anythere else?
Thanks for your help.
A
Andreas Fötschl
said
about 9 years ago
please check that CamActivity inherits from "AbstractArchitectCamActivity", so
@Override
public ArchitectUrlListener getUrlListener() { ...
}
is a valid annotation.
besides that, your code looks good.
Again, please check for difference between your sample and the official sample app, which appears to work without any issue. Also check for JS errors in your console - maybe there is a JS syntax error or other exception happening.
Kind regards
C
Cora Reyes Calens
said
almost 9 years ago
I finally got it working! I forgot I was using fragments to load the camera view.
I had to override the ArchitectUrlListener inside the SampleCamFragment class, not only in SampleCamHandlePoiDetailActivity!
The original code inside SampleCamFragment does nothing:
public ArchitectUrlListener getUrlListener() {
return new ArchitectUrlListener() {
@Override
public boolean urlWasInvoked(String uriString) {
// by default: no action applied when url was invoked
return false;
}
};
}
It needs to be overriden as in the Activity:
public ArchitectUrlListener getUrlListener() {
return new ArchitectUrlListener() {
@Override
// fetch e.g. document.location = "architectsdk://markerselected?id=1";
public boolean urlWasInvoked(String uriString) {
Uri invokedUri = Uri.parse(uriString);
if ("markerselected".equalsIgnoreCase(invokedUri.getHost())) {
final Intent poiDetailIntent = new Intent(SampleCamHandlePoiDetailActivity.this, SamplePoiDetailActivity.class);
Dimitrios Ververidis