hypery2k / nativescript-urlhandler

NativeScript URL Handler Plugin
MIT License
52 stars 34 forks source link

nativescript-Urlhandler not working in iOS. #80

Closed rohitchindarkar closed 5 years ago

rohitchindarkar commented 6 years ago

not able to call below function in iOS ,but its working fine in android. handleOpenURL((appURL: AppURL) => { console.log( appURL); } can anyone help please...

hypery2k commented 5 years ago

fixed in 1.2.3

ryanlangton commented 5 years ago

I have 1.2.3 installed and I have the same issue, nothing is happening on handleOpenURL in iOS, works fine in android.

import { Component, OnInit } from "@angular/core";
import { handleOpenURL, AppURL } from 'nativescript-urlhandler';
import { AuthService } from "./core/services/auth-service";

@Component({
    moduleId: module.id,
    selector: "ns-app",
    templateUrl: "app.component.html"
})
export class AppComponent implements OnInit {
    constructor(private auth: AuthService) {}

    ngOnInit() {
        console.log('App initialized!'); // this log shows in android and ios
        handleOpenURL((appURL: AppURL) => {
            console.log('Got the following appURL', appURL); // this log only shows in android
            const token = appURL.params['token'];
            console.log('path: ' + appURL.path);
            this.auth.login(token);
        });
    }
}