dpa99c / phonegap-launch-navigator

Phonegap/Cordova plugin which launches native route navigation apps for Android, iOS and Windows
369 stars 131 forks source link

Null Pointer iOS Google Maps Extra Parameters #212

Closed fripas closed 5 years ago

fripas commented 5 years ago

I'm submitting a ... (check one with "x"):

Bug report

Null pointer extra parameters

Current behavior:

When you try to open Google Maps and do not send extra parameters, it does not open anything.

Expected behavior:

Google Maps App open with parameters

Steps to reproduce:

Ionic 4 + @ionic-native

Output Console: unrecognized selector sent to instance 0x1b5984878

Environment information

Runtime issue

iOS build issue:

Ionic:

ionic (Ionic CLI) : 4.10.1 (/usr/local/lib/node_modules/ionic) Ionic Framework : @ionic/angular 4.0.0 @angular-devkit/build-angular : 0.12.3 @angular-devkit/schematics : 7.2.3 @angular/cli : 7.2.3 @ionic/angular-toolkit : 1.2.3

Cordova:

cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1) Cordova Platforms : android 7.1.4, browser 5.0.4, ios 4.5.5 Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.3.2, (and 7 other plugins)

System:

ios-deploy : 1.9.2 ios-sim : 5.1.0 NodeJS : v10.15.0 (/usr/local/bin/node) npm : 6.4.1 OS : macOS High Sierra Xcode : Xcode 10.1 Build version 10B61

Related code:


    let options: LaunchNavigatorOptions = {
      start: [this.datos.usuario.ubicacion.lat, this.datos.usuario.ubicacion.lng],
      app: this.launchNavigator.APP.GOOGLE_MAPS,
      enableGeocoding: false
    };

    this.launchNavigator.navigate([this.datos.destino.lat, this.datos.destino.lng], options)
      .then(
        success => console.log('Launched navigator'),
        error => console.log('Error launching navigator', error)
      );

Console output

console output `unrecognized selector sent to instance 0x1b5984878`


**Other information:** **FIX:** **File**: _src/ios/lib/LN_LaunchNavigator.m_ `Line`: ~371 `Details`: ``` if(extras){ [url appendFormat:@"%@", [self extrasToQueryParams:extras]]; } ``` `Change for`: ``` if(![self isNull:navigateParams[@"extras"]] && extras){ [url appendFormat:@"%@", [self extrasToQueryParams:extras]]; } ```
dpa99c commented 5 years ago

Fix published to npm in v5.0.1