Skip to content

How to enable logging

Jakub Dzubak edited this page Dec 22, 2025 · 2 revisions

How to enable logging

From the plugin version 7.2.1 onwards, set the loggingEnabled: true parameter at the top level of your initialization configuration to enable logging. This feature is available for both iOS and Android platforms and allows you to view native platform logs directly in your Cordova JS console.

Configuration

Add the loggingEnabled parameter at the root level of your configuration object:

MobileMessaging.init({
    applicationCode: '<Your Application Code>',
    loggingEnabled: true,
    ...
});

See the complete example in the Example App.

How it works

When logging is enabled:

  • Native SDK logs from both iOS and Android are automatically forwarded to the Cordova JS console
  • Platform native logs are displayed using console.log()

Platform-specific behavior

iOS

  • Logs appear in both Xcode console and Cordova JS console when logging is enabled

Android

  • When enabled, logs appear in Cordova JS console, otherwise you can find logs in Android Logcat
Expand for the versions before 7.2.1

To enable logging on iOS parameter logging: true needs to be provided to initialization configuration, as in the Example App

MobileMessaging.init({
    applicationCode: '<Your Application Code>',
    ios: {
        notificationTypes: ['alert', 'badge', 'sound'],
        logging: true,
    },
    ...
});

Clone this wiki locally