Start a new topic

urlWasInvoked in iOS

urlWasInvoked in iOS


Hello I'm new in iOS, I was reading some others questions about this, but I don't found the answer.

 

This is part of my code:

 

In my .h :

 

#import <UIKit/UIKit.h>

 

#import "ARViewController.h"

 

#import <WikitudeSDK/WTArchitectView.h>

 

@interface ViewController : UIViewController <WTArchitectViewDelegate>

 

@property (nonatomic, strong) WTArchitectView                   *architectView;

 

@end

 

 

 

 

 

And my .m I have this:

 

 

 

 

 

#import "ViewController.h"

 

#import <WikitudeSDK/WTArchitectView.h>

 

#import "UIDevice+SystemVersion.h"

 

#import <SystemConfiguration/SystemConfiguration.h>

 

#import "Reachability.h"

 

 

 

/* A `Pro` license key for this specific bundle identifier */

 

#define kWT_LICENSE_KEY @"gYGq7xMWnRdF2mlhKrM1wG4tHhu3vhBDn9IPu8sjnIgt27EWlyt3SaeU+GjnA1Y2pe6oCZP6hVw107RvApQ2cd+7oRPmtYRoelDDLK+34KbQZarJD90IZOQqsdDZxURw1SHn4gsSeORcYQoGFqGPH8ci94yd7vajQCche1ehJt9TYWx0ZWRfX8oa9H64mKv5uwA2UVbcF5JqLVmH/23N10shi1wEhlxpXqxIgyEx+lkTMzRKHp69z4iggBwtZX6cRzyZLs169wi/GKOh1PoUYuORgCg4eW68TW5tcfjyrms1BbIYxLH7oR/2ifCKMaXB/WuFFVa/2seZiWhM4D1dzL/I67F4jX+bc7GCvzGOGAOPWcimRYkBnNR6SzkSRsN/3/8Cz2OMIXkdEt2lu+VlMof6UToJwMA7PY7T2fh3H81U00AiRSj8mJ6X97peVwrGr03eiS03TFjqvmFHyRcvQKAvebxqzRcwWFw/UOOccDFcjEyi2Cd2aRgVxaeHEPH6bs93EEotmecXfNMSCZbNHBuWNeZ62TbZNSY63KJ+s5JrGV+wH6pXQsVg3qHKCemfyg1+Adb6S5xL9aafiy6DREK/Jm6dux8F6h2MhT6HNFJp1sgZsbmYtPH7YSjTB0AUHh8ZBN/Ar8eiOSapwI2nT3DLa94KbYHAs9oWLjik7ZA="

 

 

 

@interface ViewController ()  <WTArchitectViewDelegate>

 

@property (weak, nonatomic) IBOutlet UIImageView *bannerA;

 

@property (nonatomic, strong) NSString                  *augmentedRealityMode;

 

@end

 

@implementation ViewController

 

- (void)viewDidLoad

 

{

 

    ;

 

    // Do any additional setup after loading the view.

 

    if ( ) { // 1

 

        

 

        

 

        self.architectView = ;

 

        

 

        ; // 2

 

        

 

        NSURL *architectWorldUrl = ;

 

        ;

 

        

 

        

 

        ;// 3

 

        

 

        self.architectView.delegate = self;

 

 

    }

 

    else {

 

        

 

        NSLog(@"This device is not capable of running ARchitect Worlds. Requirements are: iOS 6 or higher, iPhone 3GS or higher, iPad 2 or higher. Note: iPod Touch 4th and 5th generation are only supported in WTAugmentedRealityMode_IR.");

 

    }

 

    

 

}

 

 

 

    -(void)viewWillAppear:(BOOL)animated {

 

        ;

 

        if ( ! ) {

 

            ;

 

        }

 

    }

 

    

 

    -(void)viewWillDisappear:(BOOL)animated {

 

        ;

 

        if ( ) {

 

            ;

 

        }

 

    }

 

- (void)urlWasInvoked:(NSString*)url

 

{

 

    NSLog(@"url was invoked in ARchitectWorld: %@", url);

 

}

 

@end

 

 

 

in my .js i have this:

 

var playButtonImgJima = new AR.ImageResource("assetsApp/play.png");

 

    var playButtonj = new AR.ImageDrawable(playButtonImgJima, 0.3, {

 

                                           enabled: false,

 

                                           clicked: false,

 

                                           onClick: function playButtonClicked() {

 

                                           World.videoj.play(1);

 

                                           World.videoj.playing = true;

 

                                           playButtonj.clicked = true;

 

                                           document.location = "architectsdk://http://auntek.com/assetsApp/jumador2.mp4"

 

                                           },

 

                                           offsetY: 0

 

                                           });

 

 

 

Apper I have all we need but don't show me the url in the NSLog 

Thaks Andreas is working now.

Hi,
- (void)urlWasInvoked:(NSString*)url is a very old and outdated WTArchitectViewDelegate method. Please refer to the latest documentation or example application to be sure to use valid code snippets.

The method you need to implement in your vie controller is:

- (void)architectView:(WTArchitectView *)architectView invokedURL:(NSURL *)URL

 

Best regards

Andreas
Login or Signup to post a comment