{"id":16675917,"url":"https://github.com/willitscale/intilery-android-example","last_synced_at":"2025-10-04T05:02:53.562Z","repository":{"id":72985712,"uuid":"59219308","full_name":"willitscale/intilery-android-example","owner":"willitscale","description":"Intilery Android SDK","archived":false,"fork":false,"pushed_at":"2016-04-26T15:06:21.000Z","size":230,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-19T21:49:47.662Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":false,"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/willitscale.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":"2016-05-19T15:30:37.000Z","updated_at":"2016-05-19T15:30:38.000Z","dependencies_parsed_at":"2023-05-12T20:15:43.146Z","dependency_job_id":null,"html_url":"https://github.com/willitscale/intilery-android-example","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/willitscale%2Fintilery-android-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willitscale%2Fintilery-android-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willitscale%2Fintilery-android-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willitscale%2Fintilery-android-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willitscale","download_url":"https://codeload.github.com/willitscale/intilery-android-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243339485,"owners_count":20275693,"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-10-12T13:08:26.120Z","updated_at":"2025-10-04T05:02:48.511Z","avatar_url":"https://github.com/willitscale.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Intilery Android SDK Example Application\n\n### Prerequisites\nBefore you start your integration you will need the following.\n\n* Google Cloud Messaging API Key\n* Intilery API Key\n* Google Services JSON file\n\n### Setting up your GCM Key\n1. Log into your [Google API Console](https://console.developers.google.com/)\n2. Navigate to the Google Cloud Messaging page, it's found under the Mobile APIs which will take you to the GCM settings page. Click the blue enable button to enable GCM for your account.\n3. On the left hand menu there should be an option called `Credentials`, this will take you to a page to generate your keys. *If you already have an API Key for your app click skip to step 6*\n4. Click `Create Credentials \u003e API key \u003e Android key`, enter your application's name, click `Add package name and fingerprint`, enter your Package Name and your SHA-1 certificate fingerprint which must be from the key you sign your applications with. When debugging you will need to use your debug keystore, but you must remember to update this when you're publishing your app to the market. You can generate the fingerprint with:\n   \n   ```\n   $ keytool -list -v -keystore mystore.keystore\n   ```\n   When debugging you will need your debug keystore (`debug.keystore`) file is found in one of the following directories:\n   *   ~/.android (Linux,Mac OS),\n   *   C:\\Documents and Settings\\[User Name]\\.android in Windows XP or \n   *   C:\\Users\\.android in Windows Vista or Windows 7 (password is `android`). \n   \n   For more information please read the [Google support page](https://support.google.com/cloud/answer/6158862?hl=en#creating-android-api-keys)\n5. Now you should have a Google API Key with GCM support (this can take a few minutes to be activated). Make note of your Google API Key which is needed for setting up your Intilery API Key.\n6. You are also going to need your Project Number which can be found in the Google API console by clicking on the three dots in the top right of the page and click on `Project Information`. Make note of your Project Number as this will be required the integration.\n\n### Setting up your Intilery API Key\n1. Log into the [Intilery app dashboard](https://www.intilery.com/app) with your account details. \n2. Navigate to the Mobile Apps page by clicking `Settings` (the cog icon) and then `Mobile Apps`.\n3. At the bottom of the page click the `Add Application` button, enter an application name (we will need this for later), select `Android Push Notifications` from the application type and click `add`.\n4. You will need to add your Google API Key to the application.\n5. Click on the `New Key` button to generate your Intilery API KEY and now you're ready to start the integration.\n\n### Google Services JSON file\nYou will need a `google-services.json` file in the example folder which can be generated from the [Google Support Site](\nhttps://developers.google.com/cloud-messaging/android/client#get-config). The file should look something like this:\n```\n{\n  \"project_info\": {\n    \"project_id\": \"PROJECT_ID\",\n    \"project_number\": \"PROJECT_NUMBER\",\n    \"name\": \"PROJECT_NAME\"\n  },\n  \"client\": [\n    {\n      \"client_info\": {\n        \"mobilesdk_app_id\": \"MOBILE_SDK_KEY_HERE\",\n        \"client_id\": \"android:com.intilery.android.example\",\n        \"client_type\": 1,\n        \"android_client_info\": {\n          \"package_name\": \"com.intilery.android.example\",\n          \"certificate_hash\": []\n        }\n      },\n      \"oauth_client\": [],\n      \"api_key\": [],\n      \"services\": {\n        \"analytics_service\": {\n          \"status\": 1\n        },\n        \"cloud_messaging_service\": {\n          \"status\": 2,\n          \"apns_config\": []\n        },\n        \"appinvite_service\": {\n          \"status\": 1,\n          \"other_platform_oauth_client\": []\n        },\n        \"google_signin_service\": {\n          \"status\": 1\n        },\n        \"ads_service\": {\n          \"status\": 1\n        }\n      }\n    }\n  ],\n  \"client_info\": [],\n  \"ARTIFACT_VERSION\": \"1\"\n}\n```\n\n### Adding the SDK Support to an application\nGo into your build.gradle and add the following to the list of dependencies\n```\ncompile 'com.intilery.android:sdk:0.1.1'\n```\n\n## Usage\nBefore use, create an instance of the Intilery API.\n```java\nnew Intilery(IntileryConfig.builder()\n    .url(\"https://www.intilery-analytics.com/api\") //Changes if you are on your own AWS cluster.\n    .intileryToken(\"*********\") //Token found in Intilery App\n    .appName(\"zed-test1\") //As found in the Intilery App\n    .rootContext(someContext) // Context used to query android APIs\n    .userAgent(\"Android App\") //Optional\n    .gcmToken(someRegistrationID) //Required for receiving push notifications\n    .build());\n    \n```\n### Sending an event\nEvent sending is achieved through an API\n```java\nIntilery.i().getIo().track(\n    IntileryEvent.builder()\n        .eventData(\n            EventData.builder(\"Event Action\", \"Event Name\") //Event name is optional.\n                .data(\"ItemData\", \n                    new MapBuilder\u003cString, Object\u003e()\n                        .put(\"Name\", \"Red K Trainers\")\n                        .put(\"Price\", \"13.99\")\n                    .build()\n                )\n            .build()\n        )\n    .build()\n);\n```\n\n### Managing User Details\nTo attach data to a visitor, e.g City, Language or any other property available within the Intilery Platform on your account - there is an API.\n```java\n    Intilery.i().getIo()\n        .setVisitorProperties(\n            PropertyUpdate.builder()\n                .property(\"First Name\", \"Tom\")\n                .property(\"Last Name\", \"Jones\")\n                .property(\"Sex\",\"Male\")\n            .build()\n        );\n```\nAdditionally if you want to get properties of a customer which Intilery is storing then you can use this API:\n```java\n\n    Intilery.i().getIo().getVisitorProperties(\n        // We now declare the receiver once we get the response from the Intilery API\n        new IntileryIO.PropertyReceiver() {\n            @Override\n            public void receive(Properties properties) {\n                // You can use properties.get(PROPERTY_NAME) to get the received property\n                System.out.println(\"The first name is: \" + properties.get(\"First Name\"));\n            }\n        }\n        // Next we list the properties we want to fetch\n        , \"First Name\", \"Last Name\");\n```\n### Managing the unique device ID\nOn first initialisation the API generates as a UUID. This UUID acts as a unique identifier for the device and is stored persistently.\nOnce created the API will contact Intilery servers to register with the platform as a device.\nYou can get the UUID we are using through:\n```java\nIntilery.i().getUserInfo().uuid();\n```\nIf you ever want to reset this device ID then you can use:\n```java\nIntilery.i().getUserInfo().reset()\n```\n\n##  Push Events\nThe Intilery Platform supports sending Push Notifications as part of a campaign. To analyse how engaging your push notifications are you may want to send an event when someone acts upon a notification (e.g opening app). In the future a set of APIs will be available to deal with this however until then please contact your account manager to find out which events you need to send to allow them to integrate with the platform.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillitscale%2Fintilery-android-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillitscale%2Fintilery-android-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillitscale%2Fintilery-android-example/lists"}