Closed Gonath closed 5 years ago
The execution is done with ngAfterViewInit and platform.ready()
async ngAfterViewInit() {
this.platform.ready().then(() => {
this.loadMap();
});
}
Yes, you have to wait this.platform.ready()
Euh… no, this is what I did but that crash.
Can you un-closed this topic ?
Please read this slides before using this plug-in. Everything are described.
Thank you but already read, it was my first implementation. Work well with Android, but I don't understand why that crash with iOS. I also read many and many topics, tutorials,... since one month.
But anyways, I'll read it again
Native side takes lot of times than js side for initialization. Implementation of iOS is different from the Android.
When you use any native plugins, you have to wait the device_ready
event. The platform.ready()
wraps that event.
Dear,
I'm coming back after rebuilding new versions from scratch with only the google map (nothing else).
Android: OK Browser: OK IOS: not ok, same problem. The app go back in the background. When I take the app to the front , again, go back in the background.
What are my steps:
Clean my home page:
<ion-content>
<div id="map_canvas"></div>
</ion-content>
Set height for the
#map_canvas {
height: 90%
}
My ts page:
import { Component, OnInit } from '@angular/core';
import { Platform } from '@ionic/angular';
import { GoogleMaps, GoogleMap, Environment } from '@ionic-native/google-maps/ngx';
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage implements OnInit {
map: GoogleMap;
constructor(private platform: Platform) {
Environment.setBackgroundColor("blue");
}
async ngOnInit() {
await this.platform.ready();
await this.loadMap();
}
loadMap() {
console.log("tests")
this.map = GoogleMaps.create('map_canvas');
}
}
I tested the multibranch version and the stable version.
When running the app, before to go back in the background, I can see the blue background.
I think I forget nothing for the steps performed. For every step, I copied-pasted into a bloc-note the executed cli-commands to know what are my steps.
Hello which Cordova IOS version are you using? I got very similar issues with 4.5.5 but they went away after upgrading to 5.0.0. can you please show us the output of the ionic info command?
On Sun, Mar 31, 2019, 19:01 Jonathan Denies notifications@github.com wrote:
I tested the multibranch version and the stable version.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ionic-team/ionic-native-google-maps/issues/189#issuecomment-478359071, or mute the thread https://github.com/notifications/unsubscribe-auth/ABJzAADA3o0pWAzw1uqIAu_6MB72569gks5vcOnjgaJpZM4cFCg_ .
I have the 4.5.5 too
Ionic:
ionic (Ionic CLI) : 4.12.0 (my path ionic modules)
Ionic Framework : @ionic/angular 4.1.2
@angular-devkit/build-angular : 0.13.7
@angular-devkit/schematics : 7.2.4
@angular/cli : 7.3.7
@ionic/angular-toolkit : 1.4.1
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 5.3.0, cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 7 other plugins)
System:
NodeJS : v10.13.0 ( my path nodejs)
npm : 6.4.1
OS : Windows 10
I'll test an upgrade to 5.0.0 this afternoon.
I am very interested in your testing results. Please keep us posted. Upgrade to version 5 helped me but it broke the support for the onesignal plugin I am using too. But that is a different issue not relevant here.
On Mon, Apr 1, 2019, 08:49 Jonathan Denies notifications@github.com wrote:
I'll test an upgrade to 5.0.0 this afternoon.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ionic-team/ionic-native-google-maps/issues/189#issuecomment-478456833, or mute the thread https://github.com/notifications/unsubscribe-auth/ABJzANqB-baGIjRSAEEJKZvsuHAjFxvwks5vcav1gaJpZM4cFCg_ .
Thanks you very much !!!!! That works !!
I never supposed that the CLI will install an older version.
You are welcome, glad it worked after upgrading to IOS 5.0.0
I'm still having this issue in ios 5.0.1, but only in ONE app, any ideas why? Already read the documentation and got this plugin working in several apps before. Already tried reinstalling the ios platform, reinstalling the plugin, installing the multiple_maps branch, .. API Keys are ok and working in another app (5.0.1, too).
Hi everyone,
I'm looking to someone having trouble when using Google Map Native plugin with IOS. Everything works fine with the browser and Android. The crash on IOS appears when performing:
this.map = GoogleMaps.create("map_canvas");
This is not really a crash. The app quit, go to the home screen of my iPhone and the app still in background. I can rerun it but "crash" again. There is no error messages, and a simple Try Catch doesn't catch the problem (and the crash always). Any solution about that ?