Merge branch 'master' of https://gitlab.chiefsoft.net/WrenchBoard/WrenchBoardIonic2023
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { Component } from '@angular/core';
|
||||
import OneSignal from 'onesignal-cordova-plugin';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
@@ -6,5 +7,57 @@ import { Component } from '@angular/core';
|
||||
styleUrls: ['app.component.scss'],
|
||||
})
|
||||
export class AppComponent {
|
||||
constructor() { }
|
||||
constructor() {
|
||||
this.OneSignalInit();
|
||||
}
|
||||
|
||||
// Call this function when your app starts
|
||||
OneSignalInit(): void {
|
||||
|
||||
// https://documentation.onesignal.com/docs/mobile-sdk
|
||||
alert('OneSignalInit');
|
||||
|
||||
// 0 = None, 1 = Fatal, 2 = Errors, 3 = Warnings, 4 = Info, 5 = Debug, 6 = Verbose
|
||||
// Uncomment to set OneSignal device logging to VERBOSE
|
||||
OneSignal.Debug.setLogLevel(6);
|
||||
|
||||
// 0 = None, 1 = Fatal, 2 = Errors, 3 = Warnings, 4 = Info, 5 = Debug, 6 = Verbose
|
||||
// Uncomment to set OneSignal visual logging to VERBOSE
|
||||
//OneSignal.Debug.setAlertLevel(6);
|
||||
OneSignal.Debug.setAlertLevel(4);
|
||||
|
||||
// NOTE: Update the init value below with your OneSignal AppId.
|
||||
OneSignal.init("13755f98-ec69-45fd-a2f1-d2166afcaa51");
|
||||
|
||||
// Location permissions enable geotagging in the OneSignal dashboard to send notifications to users based on their location
|
||||
OneSignal.Location.setShared(false);
|
||||
|
||||
let myClickListener = async function(event) {
|
||||
let notificationData = JSON.stringify(event);
|
||||
alert("CLICKED: " + notificationData);
|
||||
console.log('notificationOpenedCallback: ' + JSON.stringify(notificationData));
|
||||
|
||||
};
|
||||
OneSignal.Notifications.addEventListener("click", myClickListener);
|
||||
|
||||
// Set a handler to run before displaying a notification while the app is in focus.
|
||||
let myForegroundWillDisplayListener = async function(event) {
|
||||
let notificationData = JSON.stringify(event);
|
||||
alert("RECEIVED: " + notificationData);
|
||||
console.log('foregroundWillDisplayCallback : ' + JSON.stringify(notificationData));
|
||||
|
||||
/// Display Notification, preventDefault to not display
|
||||
event.preventDefault();
|
||||
|
||||
// Use notification.display() to display the notification after some async work
|
||||
//event.notification.display();
|
||||
};
|
||||
OneSignal.Notifications.addEventListener('foregroundWillDisplay', myForegroundWillDisplayListener);
|
||||
|
||||
// Prompts the user for notification permissions.
|
||||
// * Since this shows a generic native prompt, we recommend instead using an In-App Message to prompt for notification permission (See step 7) to better communicate to your users what notifications they will get.
|
||||
OneSignal.Notifications.requestPermission(function(accepted) {
|
||||
console.log("User accepted notifications: " + accepted);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
export const environment = {
|
||||
production: true,
|
||||
apiKey: '', // <-- Enter your own key here!' PROD
|
||||
baseUrl: 'https://apigate.orion.g1.wrenchboard.com/svs/user',
|
||||
images: 'https://apigate.orion.g1.wrenchboard.com/svs/user',
|
||||
baseUrl: 'https://apigate.nebula.g1.wrenchboard.com/svs/user',
|
||||
images: 'https://apigate.nebula.g1.wrenchboard.com/svs/user',
|
||||
loginSocial: false
|
||||
};
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
export const environment = {
|
||||
production: false,
|
||||
apiKey: '', // <-- Enter your own key here!' TEST
|
||||
baseUrl: 'https://apigate.lotus.g1.wrenchboard.com/en/wrench/api/v1',
|
||||
images: 'https://apigate.lotus.g1.wrenchboard.com/en/wrench/api/v1/',
|
||||
loginSocial: true
|
||||
baseUrl: 'https://apigate.nebula.g1.wrenchboard.com/en/wrench/api/v1',
|
||||
images: 'https://apigate.nebula.g1.wrenchboard.com/en/wrench/api/v1/',
|
||||
loginSocial: false
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user