Advanced integration guide
This section provides information on advanced integration of the Pushwoosh iOS SDK.
Background modes
To enable this functionality, you must add Background Modes to your project.
Steps to enable background modes
- Open your project in Xcode and select it in the Project Navigator.
- Choose your app target from the left panel.
- Navigate to the Signing & Capabilities tab.
- Click the + Capability button in the upper-left corner.
- Search for and select Background Modes from the list.
- In the Background Modes section, enable Remote notifications by checking the box.
Once completed, your app will be able to handle push notifications, including silent ones, while running in the background.
Foreground modes
By default, Pushwoosh iOS SDK displays the notification banner when the app is running in the foreground.
You can control this behavior by setting the following boolean flag in your code (i.e., in your AppDelegate
):
Log level
The Pushwoosh iOS SDK supports the following logging levels:
NONE
- No logs from SDK.ERROR
- Displays only error messages in the console.WARNING
- Displays warnings in addition to errors.INFO
- Includes informational messages (default setting).DEBUG
- Includes detailed debug information.
By default, the logging level is set to INFO, ensuring the SDK provides relevant information without cluttering the developer console.
To modify the logging level, update the Pushwoosh_LOG_LEVEL
key in your app’s Info.plist
file:
Replace YOUR_LOG_LEVEL
with the desired level (e.g., DEBUG
or ERROR
).
Custom UNNotificationCenterDelegate
If you want to use your own UNNotificationCenterDelegate
(for example, for local notifications), you should inform Pushwoosh SDK about it for proper behavior. You can do it with the notificationCenterDelegateProxy
property of the Pushwoosh instance:
Then, implement UNNotificationCenterDelegate
methods in your delegate:
Complete list of Info.plist properties
Property | Description | Possible Values |
---|---|---|
Pushwoosh_APPID | Sets the Pushwoosh application ID for production build. | XXXXX-XXXXX Type: String |
Pushwoosh_APPID_Dev | Sets the Pushwoosh application ID for development build. | XXXXX-XXXXX Type: String |
Pushwoosh_SHOW_ALERT | Shows notification foreground alert. | YES (default) / NO Type: Boolean |
Pushwoosh_ALERT_TYPE | Sets the notification alert style. | BANNER (default) / ALERT / NONE Type: String |
Pushwoosh_BASEURL | Overrides the Pushwoosh server base URL. | https://cp.pushwoosh.com/json/1.3/ (default) Type: String |
Pushwoosh_AUTO_ACCEPT_DEEP_LINK_FOR_SILENT_PUSH | If YES , Deep Links received in silent pushes will be processed automatically. | YES (default) / NO Type: Boolean |
Pushwoosh_ALLOW_SERVER_COMMUNICATION | Allows the SDK to send network requests to Pushwoosh servers. | YES (default) / NO Type: Boolean |
Pushwoosh_ALLOW_COLLECTING_DEVICE_DATA | Allows the SDK to collect and send device data (OS version, locale, and model) to the server. | YES (default) / NO Type: Boolean |
Pushwoosh_ALLOW_COLLECTING_DEVICE_OS_VERSION | Allows the SDK to collect and send the device’s OS version to the server. | YES (default) / NO Type: Boolean |
Pushwoosh_ALLOW_COLLECTING_DEVICE_LOCALE | Allows the SDK to collect and send the device locale to the server. | YES (default) / NO Type: Boolean |
Pushwoosh_ALLOW_COLLECTING_DEVICE_MODEL | Allows the SDK to collect and send the device model to the server. | YES (default) / NO Type: Boolean |
Pushwoosh_LOG_LEVEL | Pushwoosh SDK logging level. For details, refer to Controlling Log Level. | NONE / ERROR / WARNING / INFO (default) / DEBUG / VERBOSE Type: String |
Pushwoosh_PURCHASE_TRACKING_ENABLED | Allows the SDK to track in-app purchases. Needed for Customer Journey Builder. | YES / NO (default) Type: Boolean |