Skip to content
// Check if the user is inside the Android app
if (window.AndroidBridge || window.lahoreAdsFcmToken) {
const token = window.lahoreAdsFcmToken || window.AndroidBridge.getFcmToken();
if (token) {
// Send this token to your server via AJAX to save it for the logged-in user
fetch('/api/save-device-token.php', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ fcm_token: token })
});
}
}