{"id":20340200,"url":"https://github.com/webengage/webengage-unity-ios","last_synced_at":"2025-09-10T16:31:59.103Z","repository":{"id":82265238,"uuid":"184549638","full_name":"WebEngage/webengage-unity-ios","owner":"WebEngage","description":"WebEngage Unity Package for iOS apps built with Unity","archived":false,"fork":false,"pushed_at":"2023-03-29T11:30:34.000Z","size":24476,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-04T14:49:12.747Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"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":null,"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}},"created_at":"2019-05-02T08:51:59.000Z","updated_at":"2023-03-29T11:30:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"084cd87b-4198-4638-a258-67880b40a4fd","html_url":"https://github.com/WebEngage/webengage-unity-ios","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/WebEngage/webengage-unity-ios","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebEngage%2Fwebengage-unity-ios","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebEngage%2Fwebengage-unity-ios/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebEngage%2Fwebengage-unity-ios/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebEngage%2Fwebengage-unity-ios/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WebEngage","download_url":"https://codeload.github.com/WebEngage/webengage-unity-ios/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebEngage%2Fwebengage-unity-ios/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274487231,"owners_count":25294480,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-10T02:00:12.551Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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:12.666Z","updated_at":"2025-09-10T16:31:59.028Z","avatar_url":"https://github.com/WebEngage.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WebEngage Unity iOS\n\nWebEngage Unity iOS plugin for Unity iOS apps. This unitypackage is only for iOS and would not work on any other platform.\n\n\n## Installation\n\n 1. Download the [WebEngageUnityiOS.unitypackage](https://github.com/WebEngage/webengage-unity-ios/raw/master/WebEngageUnityiOS.unitypackage).\n\n 2. Import the downloaded unitypackage into your Unity project through `Assets` \u003e `Import Package` \u003e `Custom Package...`.\n\n\n## iOS Framework setup\n\n1. Download latest [XCFramework](https://webengage-sdk.s3.us-west-2.amazonaws.com/unity/ios/latest/WebEngage.xcframework.zip) for WebEngage\n\n2. Unzip zip file to get XCFramework file\n\n3. Copy Unzipped `XCFramework` inside your project folder\n\n4. Open Unity iOS Project in XCode\n\n5. In Xcode, go to your `Targets`, under `UnityFramework` Target, select `Build Phases`\n\n6. Add XCFramework under `Link Binary With Libraries`, You can drag and drop `XCFramework` or add thourgh + option under it\n\n![image](https://webengage-sdk.s3.us-west-2.amazonaws.com/unity/ios/images/IntegrationNativeStep.png)\n\n\n\n\n\n\n## Initialization\n\n 1. Add the following values in `/Assets/Editor/WebEngagePostProcessBuild.cs` file.\n\n ```csharp\n...\n\npublic class WebEngagePostProcessBuild\n{\n    [PostProcessBuild]\n    public static void EditXcodePlist(BuildTarget buildTarget, string pathToBuiltProject)\n    {\n        if (buildTarget == BuildTarget.iOS)\n        {\n        \t// Add your WebEngage license code\n        \tstring WEBENGAGE_LICENSE_CODE = \"YOUR-WEBENGAGE-LICENSE-CODE\";\n\n        \t// Set debug log level\n            string logLevel = \"VERBOSE\";\n        \t...\n        }\n    }\n}\n ```\n\n**Note:** Replace YOUR-WEBENGAGE-LICENSE-CODE with your own WebEngage license code.\n\n 2. Initialize the WebEngage SDK in your `AppDelegate.m` class.\n\n```objective-c\n#import \u003cWebEngage/WebEngage.h\u003e\n...\n\n-(BOOL)application:(UIApplication*) application didFinishLaunchingWithOptions:(NSDictionary*) options\n{\n    [[WebEngage sharedInstance] application:application didFinishLaunchingWithOptions:options];\n    \n    ...\n}\n\n```\n\nIf you are not already implementing `AppDelegate.m` in your Unity app, then create a new file at `/Assets/Plugins/iOS/OverrideAppDelegate.m` and copy the below contents in it.\n\n```objective-c\n#import \"UnityAppController.h\"\n#import \u003cWebEngage/WebEngage.h\u003e\n\n\n@interface OverrideAppDelegate : UnityAppController\n@end\n\n\nIMPL_APP_CONTROLLER_SUBCLASS(OverrideAppDelegate)\n\n@implementation OverrideAppDelegate\n\n-(BOOL)application:(UIApplication*) application didFinishLaunchingWithOptions:(NSDictionary*) options\n{\n    [[WebEngage sharedInstance] application:application didFinishLaunchingWithOptions:options];\n    \n    return [super application:application didFinishLaunchingWithOptions:options];\n}\n\n@end\n\n```\n\n## Tracking Users\n\n1. Login and Logout\n\n```csharp\nusing WebEngageBridge;\n...\n\npublic class YourScript : MonoBehaviour\n{\n    ...\n\n    // User login\n    WebEngage.Login(\"userId\");\n\n    // User logout\n    WebEngage.Logout();\n}\n```\n\n2. Set system user attributes as shown below.\n\n```csharp\nusing WebEngageBridge;\n...\n\npublic class YourScript : MonoBehaviour\n{\n    // Set user first name\n    WebEngage.SetFirstName(\"John\");\n\n    // Set user last name\n    WebEngage.SetLastName(\"Doe\");  \n\n    // Set user email\n    WebEngage.SetEmail(\"john.doe@email.com\");\n\n    // Set user hashed email\n    WebEngage.SetHashedEmail(\"144e0424883546e07dcd727057fd3b62\");\n\n    // Set user phone number\n    WebEngage.SetPhoneNumber(\"+551155256325\");\n\n    // Set user hashed phone number\n    WebEngage.SetHashedPhoneNumber(\"e0ec043b3f9e198ec09041687e4d4e8d\");\n\n    // Set user gender, allowed values are ['male', 'female', 'other']\n    WebEngage.SetGender(\"male\");\n\n    // Set user birth-date, supported format: 'yyyy-mm-dd'\n    WebEngage.SetBirthDate(\"1994-04-29\");\n\n    // Set user company\n    WebEngage.SetCompany(\"Google\");\n\n    // Set opt-in status, channels: ['push', 'in_app', 'email', 'sms']\n    WebEngage.SetOptIn(\"push\", true);\n\n    // Set user location\n    double latitude = 19.0822;\n    double longitude = 72.8417;\n    WebEngage.SetLocation(latitude, longitude);\n}\n```\n\n3. Set custom user attributes as shown below.\n\n```csharp\nusing WebEngageBridge;\n    ...\n    // Set custom user attributes\n    WebEngage.SetUserAttribute(\"age\", 25);\n    WebEngage.SetUserAttribute(\"premium\", true);\n\n    // Set multiple custom user attributes\n    Dictionary\u003cstring, object\u003e customAttributes = new Dictionary\u003cstring, object\u003e();\n    customAttributes.Add(\"Twitter Email\", \"john.twitter@mail.com\");\n    customAttributes.Add(\"Subscribed\", true);\n    WebEngage.SetUserAttributes(customAttributes);\n```\n\n4. Delete custom user attributes as shown below.\n\n```csharp\nusing WebEngageBridge;\n    ...\n    \n    WebEngage.DeleteUserAttribute(\"age\");\n```\n\n\n## Tracking Events\n\nTrack custom events as shown below.\n\n```csharp\nusing WebEngageBridge;\n    ...\n\n    // Track simple event\n    WebEngage.TrackEvent(\"Product - Page Viewed\");\n\n    // Track event with attributes\n    Dictionary\u003cstring, object\u003e orderPlacedAttributes = new Dictionary\u003cstring, object\u003e();\n    orderPlacedAttributes.Add(\"Amount\", 808.48);\n    orderPlacedAttributes.Add(\"Product 1 SKU Code\", \"UHUH799\");\n    orderPlacedAttributes.Add(\"Product 1 Name\", \"Armani Jeans\");\n    orderPlacedAttributes.Add(\"Product 1 Price\", 300.49);\n    orderPlacedAttributes.Add(\"Product 1 Size\", \"L\");\n    orderPlacedAttributes.Add(\"Product 2 SKU Code\", \"FBHG746\");\n    orderPlacedAttributes.Add(\"Product 2 Name\", \"Hugo Boss Jacket\");\n    orderPlacedAttributes.Add(\"Product 2 Price\", 507.99);\n    orderPlacedAttributes.Add(\"Product 2 Size\", \"L\");\n    orderPlacedAttributes.Add(\"Delivery Date\", System.DateTime.ParseExact(\"2017-10-21 09:27:37.100\", \"yyyy-MM-dd HH:mm:ss.fff\", null));\n    orderPlacedAttributes.Add(\"Delivery City\", \"San Francisco\");\n    orderPlacedAttributes.Add(\"Delivery ZIP\", \"94121\");\n    orderPlacedAttributes.Add(\"Coupon Applied\", \"BOGO17\");\n    WebEngage.TrackEvent(\"Order Placed\", orderPlacedAttributes);\n\n    // Track complex event\n    Dictionary\u003cstring, object\u003e product1 = new Dictionary\u003cstring, object\u003e();\n    product1.Add(\"SKU Code\", \"UHUH799\");\n    product1.Add(\"Product Name\", \"Armani Jeans\");\n    product1.Add(\"Price\", 300.49);\n\n    Dictionary\u003cstring, object\u003e detailsProduct1 = new Dictionary\u003cstring, object\u003e();\n    detailsProduct1.Add(\"Size\", \"L\");\n    product1.Add(\"Details\", detailsProduct1);\n\n    Dictionary\u003cstring, object\u003e product2 = new Dictionary\u003cstring, object\u003e();\n    product2.Add(\"SKU Code\", \"FBHG746\");\n    product2.Add(\"Product Name\", \"Hugo Boss Jacket\");\n    product2.Add(\"Price\", 507.99);\n\n    Dictionary\u003cstring, object\u003e detailsProduct2 = new Dictionary\u003cstring, object\u003e();\n    detailsProduct2.Add(\"Size\", \"L\");\n    product2.Add(\"Details\", detailsProduct2);\n\n    Dictionary\u003cstring, object\u003e deliveryAddress = new Dictionary\u003cstring, object\u003e();\n    deliveryAddress.Add(\"City\", \"San Francisco\");\n    deliveryAddress.Add(\"ZIP\", \"94121\");\n\n    Dictionary\u003cstring, object\u003e orderPlacedAttributes = new Dictionary\u003cstring, object\u003e();\n    List\u003cobject\u003e products = new List\u003cobject\u003e();\n    products.Add(product1);\n    products.Add(product2);\n\n    List\u003cstring\u003e coupons = new List\u003cstring\u003e();\n    coupons.Add(\"BOGO17\");\n\n    orderPlacedAttributes.Add(\"Products\", products);\n    orderPlacedAttributes.Add(\"Delivery Address\", deliveryAddress);\n    orderPlacedAttributes.Add(\"Coupons Applied\", coupons);\n\n    WebEngage.TrackEvent(\"Order Placed\", orderPlacedAttributes);\n```\n\n\n## Push Notifications\n\n 1. Build your iOS app through Unity Editor and open Unity-iPhone.xcodeproj in your Xcode IDE.\n\n 2. Select your main app target (Unity-iPhone), under Capabilities enable Push Notifications.\n\n 3. Also under Capabilities enable Background Modes and check Remote notifications.\n\n\n### Rich Push Notifications\n\n#### 1. Banner Push Notifications\n\n 1. Download the [WebEngageNotificationService.unitypackage](https://github.com/WebEngage/webengage-unity-ios/raw/master/WebEngageNotificationService.unitypackage).\n\n 2. Import the downloaded unitypackage into your Unity project through `Assets` \u003e `Import Package` \u003e `Custom Package...`.\n\n 3. Build your iOS app through Unity Editor and open Unity-iPhone.xcodeproj in your Xcode IDE.\n\n 4. Verify that NotificationService extension is added and linked to your main app target.\n\n\n#### 2. Rating and Carousel Push Notifications\n\n 1. Download the [WebEngageNotificationContent.unitypackage](https://github.com/WebEngage/webengage-unity-ios/raw/master/WebEngageNotificationContent.unitypackage).\n\n 2. Import the downloaded unitypackage into your Unity project through `Assets` \u003e `Import Package` \u003e `Custom Package...`.\n\n 3. Build your iOS app through Unity Editor and open Unity-iPhone.xcodeproj in your Xcode IDE.\n\n 4. Verify that NotificationContent extension is added and linked to your main app target.\n\n\n#### Troubleshooting for Rich Push Notifications\n\n**1. If you are facing integration or build issues with rich-push notification unity plugins, then try adding the extensions and pods manually.**\n\n 1. Remove the WebEngageNotificationService.unitypackage and WebEngageNotificationContent.unitypackage plugins (if added).\n\n 2. Build your iOS app through Unity Editor and open Unity-iPhone.xcodeproj in your Xcode IDE.\n\n 3. Follow the instructions at [WebEngage documentation](https://docs.webengage.com/docs/ios-push-messaging#section-5-rich-push-notifications).\n\n\n## In-app Notifications\n\nNo additional steps are required for in-app notifications.\n\n### Tracking Screens\n\n```csharp\nusing WebEngageBridge;\n    ...\n\t// Set screen name\n    WebEngage.ScreenNavigated(\"Purchase Screen\");\n\n    // Update current screen data\n    Dictionary\u003cstring, object\u003e currentData = new Dictionary\u003cstring, object\u003e();\n    currentData.Add(\"productId\", \"~hs7674\");\n    currentData.Add(\"price\", 1200);\n    WebEngage.SetScreenData(currentData);\n\n    // Set screen name with data\n    Dictionary\u003cstring, object\u003e data = new Dictionary\u003cstring, object\u003e();\n    data.Add(\"productId\", \"~hs7674\");\n    data.Add(\"price\", 1200);\n    WebEngage.ScreenNavigated(\"Purchase Screen\", data);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebengage%2Fwebengage-unity-ios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebengage%2Fwebengage-unity-ios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebengage%2Fwebengage-unity-ios/lists"}