{"id":20340188,"url":"https://github.com/webengage/wecontentextension","last_synced_at":"2026-02-07T13:02:22.591Z","repository":{"id":209860032,"uuid":"707028248","full_name":"WebEngage/WEContentExtension","owner":"WebEngage","description":"WebEngage iOS Content Extension","archived":false,"fork":false,"pushed_at":"2025-12-10T07:09:40.000Z","size":4899,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-10T09:25:23.328Z","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}},"created_at":"2023-10-19T04:45:57.000Z","updated_at":"2025-01-08T20:03:25.000Z","dependencies_parsed_at":"2024-06-20T15:57:04.279Z","dependency_job_id":"960e4930-cac0-4919-958b-d1f2a925754b","html_url":"https://github.com/WebEngage/WEContentExtension","commit_stats":null,"previous_names":["webengage/wecontentextension"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/WebEngage/WEContentExtension","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebEngage%2FWEContentExtension","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebEngage%2FWEContentExtension/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebEngage%2FWEContentExtension/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebEngage%2FWEContentExtension/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WebEngage","download_url":"https://codeload.github.com/WebEngage/WEContentExtension/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebEngage%2FWEContentExtension/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29194417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T12:38:28.597Z","status":"ssl_error","status_checked_at":"2026-02-07T12:38:23.888Z","response_time":63,"last_error":"SSL_read: 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:08.286Z","updated_at":"2026-02-07T13:02:22.574Z","avatar_url":"https://github.com/WebEngage.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WEContentExtension\n\n[![Version](https://img.shields.io/cocoapods/v/WEContentExtension.svg?style=flat)](https://cocoapods.org/pods/WEContentExtension)\n[![License](https://img.shields.io/cocoapods/l/WEContentExtension.svg?style=flat)](/LICENSE.txt)\n[![Platform](https://img.shields.io/cocoapods/p/WEContentExtension.svg?style=flat)](http://cocoapods.org/pods/WEContentExtension)\n[![LastUpdated](https://img.shields.io/github/last-commit/WebEngage/WEContentExtension.svg)](https://cocoapods.org/pods/WEContentExtension)\n\n# WEContentExtension\n\nWEContentExtension is extension SDK on WebEngage to support Rich push layouts inside iOS Applications\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 content extension for Project](#step-1--create-content-extension-for-project)\n- [Integrate WEContentExtension inside Content Extension](#step-2--integrate-webengage-inside-contentextension)\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 Content Extension](#step-3--import-and-use-the-webengage-inside-content-extension)\n\n  - [Swift](#swift)\n  - [Objective C](#objective-c)\n\n- [Configure ContentExtension-Info.plist](#step-4--configure-contentextension-infoplist)\n- [Configure App Groups](#step-5--create-app-groups-for-all-targets)\n- [Build and Test](#step-6--build-and-test)\n- [Migration from WebEngageAppEx to WEContentExtension](#migration-from-webengageappex-to-wecontentextension)\n\n \u003c/details\u003e\n\u003c!-- End table --\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 Langage\n\n---\n\n- ## **_Step 1 :_** Create content extension for Project\n\n  This guide provides step-by-step instructions for integrating a content extension into your iOS project. Content extensions allow you to extend the functionality of your app by providing additional content that can be displayed in various contexts, such as the Today view or Messages app.\n\n  - Open your Xcode project.\n\n  - From the menu, select `File` \u003e `New` \u003e `Target...`.\n\n  - Choose `App Extension` from the list of templates.\n\n  - Select the type of extension you want to create (e.g., ContentExtension).\n\n  - Provide a name for your extension and click `Finish`.\n\n  - #### **_Screenshots_**\n\n    \u003cp align=\"center\"\u003e\n      \u003cimg src=\"https://raw.githubusercontent.com/WebEngage/WEContentExtension/master/InetgrationScreenshots/1.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://raw.githubusercontent.com/WebEngage/WEContentExtension/master/InetgrationScreenshots/2.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://raw.githubusercontent.com/WebEngage/WEContentExtension/master/InetgrationScreenshots/3.png\" alt=\"Screenshot 3\" width=\"500\"\u003e\n    \u003c/p\u003e\n    \u003ch5 align=\"center\"\u003eScreenshot 3\u003c/h5\u003e\n\n    \u003cp align=\"center\"\u003e\n      \u003cimg src=\"https://raw.githubusercontent.com/WebEngage/WEContentExtension/master/InetgrationScreenshots/4.png\" alt=\"Screenshot 4\" width=\"250\"\u003e\n    \u003c/p\u003e\n    \u003ch5 align=\"center\"\u003eScreenshot 4\u003c/h5\u003e\n\n  ***\n\n- ### **_Step 2 :_** Integrate WebEngage inside ContentExtension\n\n  There are 2 common methods for integrating a library inside a Content Extension:\n\n  ### Note: Choose Either SPM or CocoaPods\n\n  _It's recommended to choose either Swift Package Manager or CocoaPods for integrating the library into your Content 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  - ##### Add Package Dependency\n\n    1. Navigate to `File` \u003e `Swift Packages` \u003e `Add Package Dependency...`.\n    \u003cbr\u003e\u003cbr\u003e\n      \u003cp align=\"center\"\u003e\n        \u003cimg src=\"https://raw.githubusercontent.com/WebEngage/WEContentExtension/master/InetgrationScreenshots/SPM-1.png\" alt=\"Screenshot 1 (SPM)\" width=\"1000\"\u003e\n      \u003c/p\u003e\n      \u003ch5 align=\"center\"\u003eScreenshot 1 (SPM)\u003c/h5\u003e\n\n    2. Enter the URL of the library's repository: `https://github.com/WebEngage/WEContentExtension`.\n\n    3. Click `Next`.\n\n    4. Select the branch to use or enter a specific branch requirement (master).\n\n    5. Click `Next`.\n    \u003cbr\u003e\u003cbr\u003e\n      \u003cp align=\"center\"\u003e\n        \u003cimg src=\"https://raw.githubusercontent.com/WebEngage/WEContentExtension/master/InetgrationScreenshots/SPM-2.png\" alt=\"Screenshot 1 (SPM)\" width=\"1000\"\u003e\n      \u003c/p\u003e\n      \u003ch5 align=\"center\"\u003eScreenshot 2 (SPM)\u003c/h5\u003e\n\n    6. Choose the target to which you want to add the dependency, i.e., your Content Extension target.\n\n    7. Click `Finish`.\n    \u003cbr\u003e\u003cbr\u003e\n      \u003cp align=\"center\"\u003e\n        \u003cimg src=\"https://raw.githubusercontent.com/WebEngage/WEContentExtension/master/InetgrationScreenshots/SPM-3.png\" alt=\"Screenshot 1 (SPM)\" width=\"1000\"\u003e\n      \u003c/p\u003e\n      \u003ch5 align=\"center\"\u003eScreenshot 3 (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      ```ruby\n      # this target name should be your ContentExtension Name\n      target 'ContentExtension' do\n        pod 'WEContentExtension'\n      end\n      ```\n      Note : Your target name should be the Content Extension name which you have entered while creating ContentExtension, 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 Content Extension\n\n  - #### SWIFT\n\n    1. Open **NotificationViewController.swift**\n\n    2. Import WEContentExtension by adding code `import WEContentExtension`\n\n    3. Remove all existing code from the class `NotificationViewController`\n\n    4. Add subclassing to `NotificationViewController` with `WEXRichPushNotificationViewController`\n\n      \u003cbr\u003e\n\n    `NotificationViewController.swift` will look like above below code snippet\n\n    ```swift\n    import UIKit\n    import UserNotifications\n    import UserNotificationsUI\n\n    // Import WebEngage Extension SDK\n    import WEContentExtension\n\n    // Subclassing current class with WebEngage provided class\n    class NotificationViewController: WEXRichPushNotificationViewController {\n\n        // remove all existing code inside this class\n\n    }\n    ```\n\n  - #### Objective C\n\n    1. Open **NotificationViewController.m**\n\n    2. Import `WEContentExtension`\n\n    3. Create Object of `WEContentExtension`\n\n    4. Pass necessary information to `WebEngage` through above created object\n\n    `NotificationViewController.m` will look like above below code snippet\n\n    ```Objective-C\n    #import \"NotificationViewController.h\"\n    #import \u003cUserNotifications/UserNotifications.h\u003e\n    #import \u003cUserNotificationsUI/UserNotificationsUI.h\u003e\n\n    // Step 1 : Importing WEContentExtension\n    #import \u003cWEContentExtension/WEContentExtension-Swift.h\u003e\n\n    @interface NotificationViewController () \u003cUNNotificationContentExtension\u003e\n\n    @property IBOutlet UILabel *label;\n    // Step 2 : Creating Object of content Extension\n    @property WEXRichPushNotificationViewController *weRichPushVC;\n\n    @end\n\n    @implementation NotificationViewController\n\n    // Step 3 : Pass necessary information to WebEngage\n    - (void)viewDidLoad {\n        if (_weRichPushVC == NULL){\n            _weRichPushVC = [[WEXRichPushNotificationViewController alloc]init];\n        }\n        [_weRichPushVC setUpViewsWithParentVC:self];\n        [super viewDidLoad];\n\n    }\n\n    - (void)didReceiveNotification:(UNNotification *)notification {\n        [_weRichPushVC didReceiveNotification:notification];\n    }\n\n    - (void)didReceiveNotificationResponse:(UNNotificationResponse *)response completionHandler:(void (^)(UNNotificationContentExtensionResponseOption))completion{\n        [_weRichPushVC didReceiveNotificationResponse:response completionHandler:completion];\n    }\n    @end\n    ```\n\n---\n\n- ### **_Step 4 :_** Configure ContentExtension-Info.plist\n\n  Here's how you can go about it:\n\n  - Open the `Info.plist` file for `NotificationViewController`\n\n  - Expand `NSExtension` \u003e `NSExtensionAttributes`\n\n  - Look for UNNotificationExtensionCategory under `NSExtensionAttributes`. Add it if it is not present and set the type as Array In the Array items, add:\n\n    - WEG_CAROUSEL_V1\n    - WEG_RATING_V1\n    - WEG_RICH_V1\n    - WEG_RICH_V2\n    - WEG_RICH_V3\n    - WEG_RICH_V4\n    - WEG_RICH_V5\n    - WEG_RICH_V6\n    - WEG_RICH_V7\n    - WEG_RICH_V8\n\n  - Set `UNNotificationExtensionDefaultContentHidden` under `NSExtensionAttributes` to `YES`\n\n  - Add App Transport Security Settings key under Information Property List in NotificationViewController `Info.plist` files. Set Allow Arbitrary Loads to `YES` under App Transport Security Settings in both these files.\n\n    (Note : Above step Not required if you are sure that image URLs provided for push on WebEngage dashboard will always use https.)\n\n  - Source code snippet for `Info.plist`\n\n    ```xml\n        \u003ckey\u003eNSExtension\u003c/key\u003e\n        \u003cdict\u003e\n          \u003ckey\u003eNSExtensionAttributes\u003c/key\u003e\n          \u003cdict\u003e\n            \u003ckey\u003eUNNotificationExtensionCategory\u003c/key\u003e\n            \u003carray\u003e\n              \u003cstring\u003eWEG_CAROUSEL_V1\u003c/string\u003e\n              \u003cstring\u003eWEG_RATING_V1\u003c/string\u003e\n              \u003cstring\u003eWEG_RICH_V1\u003c/string\u003e\n              \u003cstring\u003eWEG_RICH_V2\u003c/string\u003e\n              \u003cstring\u003eWEG_RICH_V3\u003c/string\u003e\n              \u003cstring\u003eWEG_RICH_V4\u003c/string\u003e\n              \u003cstring\u003eWEG_RICH_V5\u003c/string\u003e\n              \u003cstring\u003eWEG_RICH_V6\u003c/string\u003e\n              \u003cstring\u003eWEG_RICH_V7\u003c/string\u003e\n              \u003cstring\u003eWEG_RICH_V8\u003c/string\u003e\n            \u003c/array\u003e\n            \u003ckey\u003eUNNotificationExtensionDefaultContentHidden\u003c/key\u003e\n            \u003ctrue/\u003e\n            \u003ckey\u003eUNNotificationExtensionInitialContentSizeRatio\u003c/key\u003e\n            \u003creal\u003e1\u003c/real\u003e\n          \u003c/dict\u003e\n          \u003ckey\u003eNSExtensionMainStoryboard\u003c/key\u003e\n          \u003cstring\u003eMainInterface\u003c/string\u003e\n          \u003ckey\u003eNSExtensionPointIdentifier\u003c/key\u003e\n          \u003cstring\u003ecom.apple.usernotifications.content-extension\u003c/string\u003e\n        \u003c/dict\u003e\n    ```\n\n    \u003cbr\u003e\u003cbr\u003e\n\n  - `Info.plist` shoul look like below screenshot\n    \u003cbr\u003e\u003cbr\u003e\n    \u003cp align=\"center\"\u003e\n      \u003cimg src=\"https://raw.githubusercontent.com/WebEngage/WEContentExtension/master/InetgrationScreenshots/info.png\" alt=\"InfoPlist\" width=\"1000\"\u003e\n    \u003c/p\u003e\n    \u003ch5 align=\"center\"\u003einfo.plist\u003c/h5\u003e\n\n---\n\n- ### **_Step 5 :_** Create App Groups for all Targets\n\n  App Groups allow your app and the WebEngageNotificationContentExtension 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 **`NotificationViewController`** Target.\n  - #### **_Screenshots_**\n    \u003cbr\u003e\u003cbr\u003e\n      \u003cp align=\"center\"\u003e\n      \u003cimg src=\"https://raw.githubusercontent.com/WebEngage/WEContentExtension/master/InetgrationScreenshots/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://raw.githubusercontent.com/WebEngage/WEContentExtension/master/InetgrationScreenshots/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://raw.githubusercontent.com/WebEngage/WEContentExtension/master/InetgrationScreenshots/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 Content Extension to ensure that it functions as expected with the integrated library.\n\n---\n\n- ### Migration from WebEngageAppEx to WEContentExtension\n\n  - If you've been using the old content 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 WebEngageAppEx to the WEContentExtension:\n\n    - Remove `pod 'WebEngageAppEx/ContentExtension'` from the Content Extension Target `NotificationViewController` 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 `NotificationViewController.swift` file.\n        - Replace `import WebEngageAppEx` with `import WEContentExtension`.\n        - Done\n\n      - #### For Objective-C Users:\n        - Open the NotificationViewController.h file.\n        - Remove the import statement `#import \u003cWebEngageAppEx/WEXRichPushNotificationViewController.h\u003e`.\n        - Replace `WEXRichPushNotificationViewController` with `UIViewController`.\n        - Open the `NotificationViewController.m` file.\n        - Replace the code as given in Step [Objective C](#objective-c)\n\n---\n\n## License\n\nWEContentExtension is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebengage%2Fwecontentextension","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebengage%2Fwecontentextension","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebengage%2Fwecontentextension/lists"}