How to add custom sound to ionic and capacitor push notifications using one signal

Is there anyone to help adding custom sound to ionic 5 and capacitor push notification with one signal, It works good with cordova but now I want to migrate to capacitor

Upvotes: 0

Views: 1335

Answers (1)

Stream Huang
Stream Huang

Reputation: 336

I recently integrated capacitor with one signal. You can try following the instructions(step 1 to 5) in this document: https://documentation.onesignal.com/docs/ionic-sdk-setup.

The following notes may also help you:

  1. In step 2.1 "Import the OneSignal Cordova Plugin", run npm install onesignal-cordova-plugin and npx cap sync (commands in "Ionic Capacitor" tab). Cordova plugins installed in this step works all fine with Capacitor.
  2. In step 5.4 "Add a Service Extension", there are two similar extensions in Xcode named "Notification Content Extension" and "Notification Service Extension", the correct one is "Notification Service Extension" (you will see NotificationService.swift if you select this extension, otherwise you will see NotificationViewController.swift).
  3. In step 5.5.7 "You should now see all 3 frameworks", since we all use webview engine, we need to add "WebKit.framework", or your will fail and you might see the same error in this question: Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_WKWebView", referenced from:.

Upvotes: 0

Related Questions