{"id":20340222,"url":"https://github.com/webengage/ionic-3-sample","last_synced_at":"2025-06-10T11:07:17.116Z","repository":{"id":82265138,"uuid":"141598792","full_name":"WebEngage/ionic-3-sample","owner":"WebEngage","description":"Ionic-3 sample project","archived":false,"fork":false,"pushed_at":"2019-11-02T04:21:04.000Z","size":31185,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-01-14T18:10:27.259Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-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":"2018-07-19T15:31:00.000Z","updated_at":"2019-05-24T13:47:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"aeb38427-6d38-4b36-b533-e97eed000f8e","html_url":"https://github.com/WebEngage/ionic-3-sample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebEngage%2Fionic-3-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebEngage%2Fionic-3-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebEngage%2Fionic-3-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebEngage%2Fionic-3-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WebEngage","download_url":"https://codeload.github.com/WebEngage/ionic-3-sample/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241867649,"owners_count":20033815,"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","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:18.113Z","updated_at":"2025-03-04T14:44:59.906Z","avatar_url":"https://github.com/WebEngage.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# WebEngage Ionic Sample Application\n\n\nThe Ionic Sample App is tested for Ionic CLI versions 3.19.0, 3.20.0, 4.0.3 and Cordova version 8.0.0.\n\n\n## Installation\n\n```\n$ ionic cordova plugin add cordova-plugin-webengage --fetch\n```\n\n#### For ionic 5\n\n```\n$ npm install --save @ionic-native/webengage\n```\n\n#### For ionic 4\n\n```\n$ npm install --save @ionic-native/webengage@4.20.0\n```\n\n\nFor iOS platform refer [Cordova SDK installation for iOS section](https://docs.webengage.com/docs/cordova-getting-started#section-follow-the-below-steps-for-ios-platform-)\n\n\n## Integration\n\nRefer [Cordova SDK integration section](https://docs.webengage.com/docs/cordova-getting-started#section-2-integrate-the-sdk)\n\n\n## Initialization\n\nImport the following providers in your `src/app/app.module.ts` file as shown below.\n\n```typescript\n...\nimport { Webengage, WebengageUser, WebengagePush, WebengageNotification } from '@ionic-native/webengage/ngx';\n\n@NgModule({\n    ...\n    providers: [\n        ...,\n        Webengage, WebengageUser, WebengagePush, WebengageNotification\n    ]\n});\n...\n```\n\nNow, initialize the WebEngage SDK in `src/app/app.component.ts` file as shown below.\n\n```typescript\n...\nimport { Webengage } from '@ionic-native/webengage/ngx';\n\n@Component({\n  templateUrl: 'app.html'\n})\nexport class MyApp {\n    ...\n\n    constructor(..., private webengage: Webengage) {\n    \n        platform.ready().then(() =\u003e {\n            ...\n\n            // Initialize WebEngage\n            this.webengage.engage()\n                .then(res =\u003e console.log(res))\n                .catch(err =\u003e console.log(err));\n\n            ...\n        });\n    }\n}\n```\n\n\n## Configurations\n\nRefer [Configurations for WebEngage Cordova Plugin](https://github.com/WebEngage/cordova-plugin#configurations).\n\n\n## Tracking Users\n\nYou can track users as shown in the following example.\n\n```typescript\n...\nimport { WebengageUser } from '@ionic-native/webengage/ngx';\n\nexport class YourPage {\n    ...\n    constructor(..., private webengageUser: WebengageUser) { }\n\n    // Login\n    this.webengageUser.login(\"user-id\");\n\n    // Logout\n    this.webengageUser.logout();\n\n    // Set system user attributes\n    this.webengageUser.setAttribute(\"we_first_name\", \"John\");\n    this.webengageUser.setAttribute(\"we_last_name\", \"Doe\");\n    this.webengageUser.setAttribute(\"we_email\", \"john.doe@gmail.com\");\n    this.webengageUser.setAttribute(\"we_birth_date\", \"1986-08-19\");\n    this.webengageUser.setAttribute(\"we_phone\", \"+551155256325\");\n    this.webengageUser.setAttribute(\"we_gender\", \"male\");  // Supported values: 'male', 'female', 'other'\n    this.webengageUser.setAttribute(\"we_company\", \"Alphabet Inc.\");\n    this.webengageUser.setAttribute(\"we_hashed_email\", \"144e0424883546e07dcd727057fd3b62\");\n    this.webengageUser.setAttribute(\"we_hashed_phone\", \"e0ec043b3f9e198ec09041687e4d4e8d\");\n\n    // Set custom user attributes\n    this.webengageUser.setAttribute(\"Category\", \"GOLD\");\n    this.webengageUser.setAttribute(\"Value Index\", 5.06);\n    this.webengageUser.setAttribute(\"Inactive\", false);\n    this.webengageUser.setAttribute(\"Registered On\", new Date(\"2015-11-09T10:01:11.000Z\"));\n}\n```\n\n\n## Tracking Events\n\nYou can track events as shown in the following example.\n\n```typescript\n...\nimport { Webengage } from '@ionic-native/webengage/ngx';\n\nexport class YourPage {\n    ...\n    constructor(..., private webengage: Webengage) { }\n\n    // Track event\n    this.webengage.track(\"Added to cart\");\n\n    // Track event with attributes\n    var attributes = {};\n    attributes[\"product-id\"] = \"12345\";\n    attributes[\"product-name\"] = \"wrist-watch\";\n    attributes[\"product-price\"] = 25.65;\n    this.webengage.track(\"Purchased\", attributes);\n}\n```\n\n\n## Push Notifications\n\nRefer [Push Integration for WebEngage Cordova Plugin](https://github.com/WebEngage/cordova-plugin#push-notifications).\n\n\n## In-app Notifications\n\nRefer [In-app Integration for WebEngage Cordova Plugin](https://github.com/WebEngage/cordova-plugin#in-app-notifications).\n\n\n## Troubleshooting\n\nRefer [Troubleshooting for WebEngage Cordova Plugin](https://github.com/WebEngage/cordova-plugin#troubleshooting).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebengage%2Fionic-3-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebengage%2Fionic-3-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebengage%2Fionic-3-sample/lists"}