Closed dariopellegrini closed 6 years ago
Error fixed making tns platform remove android and tns platform add android. Here's the code for a NativeScript Angular app.
import { Component } from "@angular/core";
import { on as applicationOn, launchEvent, suspendEvent, resumeEvent, exitEvent, lowMemoryEvent, uncaughtErrorEvent, ApplicationEventData, start as applicationStart } from "application";
@Component({
selector: "ns-app",
templateUrl: "app.component.html",
})
export class AppComponent {
}
import * as application from 'application';
var TnsOneSignal = require('nativescript-onesignal').TnsOneSignal
applicationOn(launchEvent, function (args: ApplicationEventData) {
if (args.android) {
// For Android applications, args.android is an android.content.Intent class.
console.log("Launched Android application with the following context: " + application.android.context + ".")
TnsOneSignal.startInit(application.android.context)
.init()
}
});
TnsOneSignal is undefined in Android with latest version installed with tns.
Any solution? com.onesignal.OneSignal is undefined as well.