it's my first project on NativeScript (ns), so I'm a bit new to it, and do not know how everything works in ns world.
For my project I setup ns+vue+ts projects with latest ns version, which is 8.1.5.
All was fine until I start adding some libraries. The first alarm bell was installing and setup of nativescript-google-maps-sdk, every tutorial and official docs telling that you need turn on SDK in a way like this (examples may differ a bit but all of them wants platform):
import * as platform from "platform";
if (platform.isIOS) {
GMSServices.provideAPIKey("PUT_API_KEY_HERE");
}
Vue.registerElement('MapView', () => require('nativescript-google-maps-sdk').MapView);
but my installed NativeScript does not have platfrom, instead I made it work with
import {isIOS } from "@nativescript/core";
if (isIOS) {
GMSServices.provideAPIKey("PUT_API_KEY_HERE");
}
Vue.registerElement('MapView', () => require('nativescript-google-maps-sdk').MapView);
Second issue which I did not solve yet is nativescript/geolocation. After I install that package I'm not able to run my ios emulator, it's failing with error:
ERROR in ./node_modules/nativescript-geolocation/geolocation.ios.js 8:15-34
Module not found: Error: Can't resolve 'platform' in '/Users/myuser/projects/app/node_modules/nativescript-geolocation'
Am I doing something wrong, or ns of version 8.1.5 not supported yet????