Skip to main content

Setup

Before setting up the SDK, please make sure you have followed the steps to setup the Raven In-App Integration first. Step 1 Run the following commands in your project root directory.
Step 2 Import RavenInAppModule from ‘@ravenapp/raven-inapp-angular’ and add it to the imports array in the app.module.ts file.
Step 3 Intialize library by calling intialize method in app.component.ts.
Step 4 Please refer to the below code to consume the InApp Angular SDK in your app.
  • Do not forget to call deintialize method when user logs out otherwise user will receive notifications event after logging out. You can access the deintialize method by importing CountService.
  • When display style is ‘fullScreen’, there will not be bell icon. Inorder to access new notification’s count, import the CountService and subscribe the count.
  • When display style is ‘fullScreen’, you can remove the header by passing header= to the inapp-notification-center component. In that case, you can access to the unread count, mark all read, reload data by importing CountService.
    • deintialize - <CountServiceObj>.deintialize()
    • mark all read - <CountServiceObj>.markAllRead()
    • reload data - <CountServiceObj>.reloadData()
    • unread count - <CountServiceObj>.unreadCount

In-App Angular Demo App

You can follow the below process to see the demo of In-App Angular SDK. Step 1 Clone this repo.
Step 2 If you haven’t installed angular cli, install it using the following command.
If you are using a mac, use
Step 3 After installing angular cli, run the following command in the project root directory.
Step 4 Change the userId, appId and signature variables in projects/test/src/app/app.component.ts. Step 5 Run the following command in the project root directory to start the app.