{"id":20340186,"url":"https://github.com/webengage/weserviceextension","last_synced_at":"2026-04-02T18:45:21.525Z","repository":{"id":209860121,"uuid":"707027380","full_name":"WebEngage/WEServiceExtension","owner":"WebEngage","description":"WebEngage iOS Notification Service Extension","archived":false,"fork":false,"pushed_at":"2025-12-19T03:27:54.000Z","size":3930,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-26T09:09:06.951Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WebEngage.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-10-19T04:42:33.000Z","updated_at":"2025-12-19T02:47:28.000Z","dependencies_parsed_at":"2024-04-25T23:58:34.842Z","dependency_job_id":"88d024b0-eb1c-43c9-ad71-fc00e0001eb0","html_url":"https://github.com/WebEngage/WEServiceExtension","commit_stats":null,"previous_names":["webengage/weserviceextension"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/WebEngage/WEServiceExtension","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebEngage%2FWEServiceExtension","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebEngage%2FWEServiceExtension/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebEngage%2FWEServiceExtension/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebEngage%2FWEServiceExtension/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WebEngage","download_url":"https://codeload.github.com/WebEngage/WEServiceExtension/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebEngage%2FWEServiceExtension/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31313296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T21:20:07.747Z","updated_at":"2026-04-02T18:45:21.511Z","avatar_url":"https://github.com/WebEngage.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WEServiceExtension\n\n[![Version](https://img.shields.io/cocoapods/v/WEServiceExtension.svg)](https://cocoapods.org/pods/WEServiceExtension)\n[![License](https://img.shields.io/github/license/WebEngage/WEServiceExtension.svg)](http://cocoapods.org/pods/WEServiceExtension)\n[![Platform](https://img.shields.io/cocoapods/p/WEServiceExtension.svg?style=flat)](http://cocoapods.org/pods/WEServiceExtension)\n[![LastUpdated](https://img.shields.io/github/last-commit/WebEngage/WEServiceExtension.svg)](https://cocoapods.org/pods/WEServiceExtension)\n\n---\n\n**Push notification service extensions** in iOS are needed to make notifications more interesting by adding images, videos, or interactive buttons. They also ensure that sensitive tasks, like processing user data, are done securely without affecting the app's performance.\n\n## \u003c!-- Start table --\u003e\n\n### Table of Content\n\n\u003cdetails\u003e\n    \u003csummary\u003eClick to Expand\u003c/summary\u003e\n\n- [Create service extension for Project](#step-1--create-service-extension-for-project)\n- [Integrate WEServiceExtension inside Service Extension](#step-2--integrate-weserviceextension-inside-service-extension)\n  - [Approach 1 : SPM](#approach-1--integrating-via-spm)\n  - [Approach 2 : Cocoapods](#approach-2--integrating-via-cocoapods)\n- [Import and Use the WebEngage inside Service Extension](#step-3--import-and-use-the-webengage-inside-service-extension)\n\n  - [Swift](#swift)\n  - [Objective C](#objective-c)\n\n- [Configure ServiceExtension-Info.plist](#step-4--configure-serviceextension-infoplist)\n- [Add App Groups](#step-5--create-app-groups-for-all-targets)\n- [Build and Test](#step-6--build-and-test)\n- [Migration from WebEngageBannerPush to WEServiceExtension](#migration-from-webengagebannerpush-to-weserviceextension)\n\n  \u003c/details\u003e\n  \u003c!-- End table --\u003e\n\n## \u003c!-- Start Of Step 1 --\u003e\n\n## Prerequisites\n\n- WebEngage SDK needs to be integrated inside project\n- Basic knowledge of Service Extension and Content Extension\n- Basic knowledge about push notification , swift / Objc Programing Language\n\n---\n\n- ## **_Step 1 :_** Create service extension for Project\n\n  - In Xcode, navigate to `File` \u003e `New` \u003e `Target` and select `Notification Service Extension` then `Next`\n\n  - Enter the Product Name as `NotificationService`, and click Finish.\n\n  - Click Activate on the prompt shown to activate the service extension. Xcode will now create a new top-level folder in your project with the name `NotificationService`.\n\n  - #### **_Screenshots_**\n\n    \u003cp align=\"center\"\u003e\n      \u003cimg src=\"https://github.com/WebEngage/WEServiceExtension/blob/docs/readme/assets/2.png\" alt=\"Screenshot 1\" width=\"1000\"\u003e\n    \u003c/p\u003e\n    \u003ch5 align=\"center\"\u003eScreenshot 1\u003c/h5\u003e\n\n    \u003cp align=\"center\"\u003e\n      \u003cimg src=\"https://github.com/WebEngage/WEServiceExtension/blob/docs/readme/assets/3.png\" alt=\"Screenshot 2\" width=\"1000\"\u003e\n    \u003c/p\u003e\n    \u003ch5 align=\"center\"\u003eScreenshot 2\u003c/h5\u003e\n\n    \u003cp align=\"center\"\u003e\n      \u003cimg src=\"https://github.com/WebEngage/WEServiceExtension/blob/docs/readme/assets/4.png\" alt=\"Screenshot 3\" width=\"1000\"\u003e\n    \u003c/p\u003e\n    \u003ch5 align=\"center\"\u003eScreenshot 3\u003c/h5\u003e\n\n    \u003cp align=\"center\"\u003e\n      \u003cimg src=\"https://github.com/WebEngage/WEServiceExtension/blob/docs/readme/assets/5.png\" alt=\"Screenshot 4\" width=\"1000\"\u003e\n    \u003c/p\u003e\n    \u003ch5 align=\"center\"\u003eScreenshot 4\u003c/h5\u003e\n\n\u003c!-- End of Step 1 --\u003e\n\n---\n\n\u003c!-- Start of  --\u003e\n\n- ### **_Step 2 :_** Integrate WEServiceExtension inside Service Extension\n\n  There are 2 common methods for integrating a library inside a Service Extension:\n\n  ### Note: Choose Either SPM or CocoaPods\n\n  \u003e _It's recommended to choose either Swift Package Manager or CocoaPods for integrating the library into your Service Extension. Mixing both methods might lead to conflicts or inconsistencies in your project setup._\n\n  ***\n\n  ### **\u003cu\u003eApproach 1\u003c/u\u003e :** Integrating via **_SPM_**\n\n  - Select your `Project` \u003e `Package Dependencies` \u003e `+` button.\n    Enter Package URL: `https://github.com/WebEngage/WEServiceExtension.git` in the search bar.\n\n    ```\n    https://github.com/WebEngage/WEServiceExtension.git\n    ```\n\n    \u003cbr\u003e\n    \u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://github.com/WebEngage/WEServiceExtension/blob/docs/readme/assets/p1.png\" alt=\"Screenshot 1 (SPM)\" width=\"1000\"\u003e\n    \u003c/p\u003e\n    \u003ch5 align=\"center\"\u003eScreenshot 1 (SPM)\u003c/h5\u003e\n\n    \u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://github.com/WebEngage/WEServiceExtension/blob/docs/readme/assets/p2.png\" alt=\"Screenshot 2 (SPM)\" width=\"1000\"\u003e\n    \u003c/p\u003e\n    \u003ch5 align=\"center\"\u003eScreenshot 2 (SPM)\u003c/h5\u003e\n\n    \u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://github.com/WebEngage/WEServiceExtension/blob/docs/readme/assets/p3.png\" alt=\"Screenshot 3 (SPM)\" width=\"1000\"\u003e\n    \u003c/p\u003e\n    \u003ch5 align=\"center\"\u003eScreenshot 3 (SPM)\u003c/h5\u003e\n\n  - Under `Add to Target` select `NotificationService` (Your Service Extension Target).\n  \u003cbr\u003e\u003cbr\u003e\n     \u003cp align=\"center\"\u003e\n      \u003cimg src=\"https://github.com/WebEngage/WEServiceExtension/blob/docs/readme/assets/p4.png\" alt=\"Screenshot 4 (SPM)\" width=\"1000\"\u003e\n      \u003c/p\u003e\n      \u003ch5 align=\"center\"\u003eScreenshot 4 (SPM)\u003c/h5\u003e\n\n  - Click `Add Package`.\n  \u003cbr\u003e\u003cbr\u003e\n    \u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://github.com/WebEngage/WEServiceExtension/blob/docs/readme/assets/p5.png\" alt=\"Screenshot 5 (SPM)\" width=\"1000\"\u003e\n    \u003c/p\u003e\n    \u003ch5 align=\"center\"\u003eScreenshot 5 (SPM)\u003c/h5\u003e\n\n  ***\n\n    \u003ch5 align=\"center\"\u003eOR\u003c/h5\u003e\n\n  ***\n\n  ### **\u003cu\u003eApproach 2\u003c/u\u003e :** Integrating via **_CocoaPods_**\n\n  - #### Prerequisites\n\n    - Cocoapods should be installed inside your system\n\n    - podfile should be available for your project\n\n  - #### Edit Podfile\n\n    - Open the Podfile using a text editor.\n\n    - Add the library dependency to the Podfile. For example:\n\n      ```ruby\n      # this target name should be your ServiceExtension Name\n      target 'NotificationService' do\n        # Uncomment the line below if the parent target also uses frameworks\n        # use_frameworks!\n        pod 'WEServiceExtension'\n        # Add other pods for the NotificationService target here\n      end\n      ```\n\n      Note : Your target name should be the Service Extension name which you have entered while creating ServiceExtension, Over here refer screenshot 3\n\n    - #### Install Pods\n\n      - Save the changes to the Podfile.\n\n      - Install the pods by running the following command:\n        ```shell\n        pod install\n        ```\n\n---\n\n- ### **_Step 3 :_** Import and Use the WebEngage inside Service Extension\n\n  - #### SWIFT\n\n    1.  Open **NotificationService.swift**\n    2.  Import **WEServiceExtension** by adding code `import WEServiceExtension`\n    3.  Remove all existing code from the class `NotificationService`\n    4.  Add subclassing to `NotificationService` with `WEXPushNotificationService`\n\n        ```swift\n        import UserNotifications\n        // Step 1 : Importing WEServiceExtension\n        import WEServiceExtension\n\n        // Step 2 : Subclassing service Extension\n        class NotificationService: WEXPushNotificationService {\n        }\n\n        ```\n\n  - #### Objective C\n\n    1.  Open **NotificationService.m**\n    2.  Import `WEServiceExtension/WEServiceExtension-Swift.h`\n    3.  Create Object of `WEXPushNotificationService`\n    4.  Pass necessary information to `WebEngage` through above created object\n\n    `NotificationService.m` will look like below code snippet\n\n    ```Objective-C\n    #import \"NotificationService.h\"\n      // Step 1 : Importing WEServiceExtension\n      #import \u003cWEServiceExtension/WEServiceExtension-Swift.h\u003e\n\n      @interface NotificationService ()\n      // Step 2 : Creating Object of service Extension\n      @property (nonatomic, strong) WEXPushNotificationService *serviceExtension;\n\n      @end\n\n      @implementation NotificationService\n\n      // Step 3 : Pass necessary information to WebEngage\n      - (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler {\n          if (_serviceExtension == NULL){\n              _serviceExtension = [[WEXPushNotificationService alloc]init];\n          }\n          [_serviceExtension didReceiveNotificationRequest:request\n                                        withContentHandler:contentHandler];\n      }\n\n      - (void)serviceExtensionTimeWillExpire {\n          // Called just before the extension will be terminated by the system.\n          // Use this as an opportunity to deliver your \"best attempt\" at modified content, otherwise the original push payload will be used.\n          [_serviceExtension serviceExtensionTimeWillExpire];\n      }\n\n      @end\n    ```\n\n- ### **_Step 4 :_** Configure ServiceExtension-Info.plist\n\n  Here's how you can go about it:\n\n  - Open the `Info.plist` file for `NotificationService`\n  - Add `App Transport Security Settings` key under `Information Property List` in `NotificationService-Info.plist` file.\n  - Set `Allow Arbitrary` Loads to `YES` under `App Transport Security Settings` - Not required if you are sure that image URLs provided on `WebEngage` dashboard will always use `https`.\n  \u003cbr\u003e\u003cbr\u003e\n    \u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://github.com/WebEngage/WEServiceExtension/blob/docs/readme/assets/appGroup/4.png\" alt=\"Screenshot 1\" width=\"1000\"\u003e\n    \u003c/p\u003e\n    \u003ch5 align=\"center\"\u003eScreenshot 1\u003c/h5\u003e\n\n- ### **_Step 5 :_** Create App Groups for all Targets\n\n  App Groups allow your app and the WebEngageNotificationServiceExtension to communicate when a notification is received, even if your app is not active. This is required for Confirmed Deliveries.\n\n  - Select your `Main App Target` \u003e `Signing \u0026 Capabilitie`s \u003e `+ Capability` \u003e `App Groups`.\n  - Within `App Groups`, click the `+` button.\n  - Set the App Groups container to be `group.YOUR_BUNDLE_IDENTIFIER.WEGNotificationGroup` where `YOUR_BUNDLE_IDENTIFIER` is the same as your Main Application \"`Bundle Identifier`\".\n  - Press `OK` and repeat for the **`NotificationService`** Target.\n  - #### **_Screenshots_**\n    \u003cbr\u003e\u003cbr\u003e\n      \u003cp align=\"center\"\u003e\n      \u003cimg src=\"https://github.com/WebEngage/WEServiceExtension/blob/docs/readme/assets/appGroup/1.png\" alt=\"Screenshot 1\" width=\"1000\"\u003e\n      \u003c/p\u003e\n      \u003ch5 align=\"center\"\u003eScreenshot 1\u003c/h5\u003e\n      \u003cbr\u003e\u003cbr\u003e\n      \u003cp align=\"center\"\u003e\n      \u003cimg src=\"https://github.com/WebEngage/WEServiceExtension/blob/docs/readme/assets/appGroup/2.png\" alt=\"Screenshot 1\" width=\"1000\"\u003e\n      \u003c/p\u003e\n      \u003ch5 align=\"center\"\u003eScreenshot 2\u003c/h5\u003e\n      \u003cbr\u003e\u003cbr\u003e\n      \u003cp align=\"center\"\u003e\n      \u003cimg src=\"https://github.com/WebEngage/WEServiceExtension/blob/docs/readme/assets/appGroup/3.png\" alt=\"Screenshot 1\" width=\"1000\"\u003e\n      \u003c/p\u003e\n      \u003ch5 align=\"center\"\u003eScreenshot 3\u003c/h5\u003e\n\n---\n\n- ### **_Step 6 :_** Build and Test\n\n  - Build your project to ensure that the library integrates successfully.\n\n  - Test your Service Extension to ensure that it functions as expected with the integrated library.\n\n---\n\n- ### Migration from WebEngageBannerPush to WEServiceExtension\n\n  - If you've been using the old service extension and want to switch to the new one, just stick to these instructions in the documentation:\n\n  - Below are the steps to migrate from WebEngageBannerPush to the WEServiceExtension:\n\n    - Remove `pod 'WebEngageBannerPush'` from the Service Extension Target `NotificationService` in the podfile.\n    - Then Perform `pod install`\n    - Then Follow Step [Approach 2 : Cocoapods](#approach-2--integrating-via-cocoapods)\n    - After successfully completing the above step, let's move to the code section:\n\n      - #### For Swift Users :\n\n        - Open the `NotificationService.swift` file.\n        - Replace `import WebEngageBannerPush` with `import WEServiceExtension`.\n        - Done\n\n      - #### For Objective-C Users:\n        - Open the NotificationService.h file.\n        - Remove the import statement `#import \u003cWebEngageBannerPush/WEXPushNotificationService.h\u003e`.\n        - Replace `WEXPushNotificationService` with `UNNotificationServiceExtension`.\n        - Open the `NotificationService.m` file.\n        - Replace the code as given in Step [Objective C](#objective-c)\n\n## License\n\nWEServiceExtension is available under the MIT license. See the LICENSE file for more info.\n\n###\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebengage%2Fweserviceextension","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebengage%2Fweserviceextension","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebengage%2Fweserviceextension/lists"}