-
Notifications
You must be signed in to change notification settings - Fork 33
[MOB-5828] Firetv updateuser fix #532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Ayyanchira
merged 10 commits into
Iterable:master
from
amanjayshahomnicg:firetv-updateuser-fix
May 16, 2023
Merged
Changes from 5 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
124c04e
Add firetv/ott support to getmessages call
amanforindia 898f9e9
For firetv call update user with device details upon initialization
amanforindia e3a277f
Set DEVICE_NOTIFICATIONS_ENABLED key only when registering for push
amanforindia 6f55d7f
Fix firetv object structure
amanforindia f0f1efb
Review fixes
amanforindia 6c0a9a2
Merge branch 'master' into firetv-updateuser-fix
Ayyanchira 0236ee2
add private constructor to prevent instance creation
devcsomnicg 90902c2
update unit test
devcsomnicg a287522
Added import for DeviceInfoUtils
devcsomnicg e232049
Merge branch 'master' into firetv-updateuser-fix
Ayyanchira File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
iterableapi/src/main/java/com/iterable/iterableapi/util/DeviceInfoUtils.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| package com.iterable.iterableapi.util; | ||
|
|
||
| import android.content.Context; | ||
| import android.content.pm.PackageManager; | ||
| import android.os.Build; | ||
|
|
||
| import com.iterable.iterableapi.IterableConstants; | ||
| import com.iterable.iterableapi.IterableUtil; | ||
|
|
||
| import org.json.JSONException; | ||
| import org.json.JSONObject; | ||
|
|
||
| public final class DeviceInfoUtils { | ||
|
|
||
| private DeviceInfoUtils() { | ||
| } | ||
|
|
||
| public static boolean isFireTV(PackageManager packageManager) { | ||
| String amazonFireTvHardware = "amazon.hardware.fire_tv"; | ||
| String amazonModel = Build.MODEL; | ||
| return amazonModel.matches("AFTN") || packageManager.hasSystemFeature(amazonFireTvHardware); | ||
| } | ||
| public static void populateDeviceDetails(JSONObject dataFields, Context context, String deviceId) throws JSONException { | ||
| dataFields.put(IterableConstants.DEVICE_BRAND, Build.BRAND); //brand: google | ||
| dataFields.put(IterableConstants.DEVICE_MANUFACTURER, Build.MANUFACTURER); //manufacturer: samsung | ||
| dataFields.put(IterableConstants.DEVICE_SYSTEM_NAME, Build.DEVICE); //device name: toro | ||
| dataFields.put(IterableConstants.DEVICE_SYSTEM_VERSION, Build.VERSION.RELEASE); //version: 4.0.4 | ||
| dataFields.put(IterableConstants.DEVICE_MODEL, Build.MODEL); //device model: Galaxy Nexus | ||
| dataFields.put(IterableConstants.DEVICE_SDK_VERSION, Build.VERSION.SDK_INT); //sdk version/api level: 15 | ||
|
|
||
| dataFields.put(IterableConstants.DEVICE_ID, deviceId); // Random UUID | ||
| dataFields.put(IterableConstants.DEVICE_APP_PACKAGE_NAME, context.getPackageName()); | ||
| dataFields.put(IterableConstants.DEVICE_APP_VERSION, IterableUtil.getAppVersion(context)); | ||
| dataFields.put(IterableConstants.DEVICE_APP_BUILD, IterableUtil.getAppVersionCode(context)); | ||
| dataFields.put(IterableConstants.DEVICE_ITERABLE_SDK_VERSION, IterableConstants.ITBL_KEY_SDK_VERSION_NUMBER); | ||
| } | ||
Ayyanchira marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.