Skip to content

Commit

Permalink
4.0.0
Browse files Browse the repository at this point in the history
Deprecates iOS in favor of native Ti methods, updates Android to use ti.playservices.
  • Loading branch information
ygbr committed Sep 12, 2019
1 parent 9c0d5b8 commit a5c0b97
Show file tree
Hide file tree
Showing 35 changed files with 165 additions and 1,715 deletions.
48 changes: 19 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
### Compatibility

Tested for Compatibility with:
* Ti SDK 6.0.3.GA
* Ti SDK 8.1.1.GA

Althought we've managed to build the module to work on Ti SDK 5.x, it causes so many conflicts with other jars in the Android version that made us simply give up making it work. It works fine for iOS on Ti 5 and you're welcome to download the source and build it for Ti 5. (See issues#1)

Expand All @@ -15,44 +15,29 @@ Implementation details for each platform are described below:

### iOS

For iOS we have mapped 3 main methods, one that verifies if the AdvertisingID is allowed to be read by your app and the other two for returning both the advertisingId itself and the vendorId.
**DEPRECATED!!!**

#### iOS Attributes:
For iOS, the current Titanium SDK GA (8.1.1.GA) already provides access to the Ads Identifiers therefore this module is not required anymore in order to access those parameters.

*isAdvertisingTrackingEnabled* (Boolean)
You can use the following accessors on the latest versions of Titanium:

> Returns a boolean indicating if the user has allowed the advertisingId to be tracked. According to Apple Guidelines this must always be respected and verified before calling the advertisingIdentifier method for retrieving it.
> Always calls this before calling the **advertisingIdentifier** method.
*advertisingIdentifier* (String)

> Returns Apple's advertisingIdentifier according to the official iOS Docs: [advertisingIdentifier](https://developer.apple.com/reference/adsupport/asidentifiermanager/1614151-advertisingidentifier?language=objc)
> In iOS 10.0 and later, the value of advertising​Identifier is all zeroes when the user has limited ad tracking.
*identifierForVendor* (String)

> The value of this property is the same for apps that come from the same vendor running on the same device. A different value is returned for apps on the same device that come from different vendors, and for apps on different devices regardless of vendor.
> Normally, the vendor is determined by data provided by the App Store. If the app was not installed from the app store (such as enterprise apps and apps still in development), then a vendor identifier is calculated based on the app’s bundle ID. The bundle ID is assumed to be in reverse-DNS format.
> On iOS 6, the first two components of the bundle ID are used to generate the vendor ID. if the bundle ID only has a single component, then the entire bundle ID is used.
> On IOS 7, all components of the bundle except for the last component are used to generate the vendor ID. If the bundle ID only has a single component, then the entire bundle ID is used.
>
> When implementing a system for serving advertisements, use the value in the advertisingIdentifier property of the ASIdentifierManager class instead of this property. Use of that property requires you to follow the guidelines set forth in the class discussion for the proper use of that identifier. For more information, see ASIdentifierManager.
>
> https://developer.apple.com/reference/uikit/uidevice/1620059-identifierforvendor
>
#### iOS References:

* https://developer.apple.com/reference/adsupport/asidentifiermanager
* https://developer.apple.com/reference/adsupport/asidentifiermanager/1614151-advertisingidentifier
* https://developer.apple.com/reference/uikit/uidevice/1620059-identifierforvendor
- Ti.Platform.identifierForVendor
- Ti.Platform.identifierForAdvertising
-Ti.Platform.isAdvertisingTrackingEnabled

Please refer to official Ti Documentation for more info.

### Android

On Android we mapped the method getAdvertisingIdInfo from the AdvertisingIdClient API available as part of the Google Play Services.
Be aware that this requires the GooglePlayServices to be installed on the user's device in order to work properly and this also requires the GooglePlayServices base jar and the ads jar (both included on the android/lib). I have tried my best to use a version of those JARs that doesn't conflict with other modules like ti.map but JAR hell might happen.

> The module is still needed on Android as of Ti 8.1.1.GA since I couldn't find a clean way to use AsyncTask with Hyperloop since we need to access the AdvertisingIdClient out of the main thread. Thus this module is still required for Android
#### Deprecations

I have deprecated the *getAndroidID* method since the same info can be fetched using Ti.Platform.id on current Titanium versions.

#### Android Methods:

*getAdvertisingIdInfo* (String)
Expand All @@ -66,6 +51,9 @@ Be aware that this requires the GooglePlayServices to be installed on the user's
*getAndroidID* (String)

*DEPRECATED* - Use Ti.Platform.id directly.


> Returns the **ANDROID_ID** of the user device from Android SDK Settings.Secure.
> A 64-bit number (as a hex string) that is randomly generated when the user first sets up the device and should remain constant for the lifetime of the user's device.
> This can be used as an equivalent to iOS identifierForVendor on Android although it is not reseted on every installation.
Expand All @@ -74,6 +62,8 @@ Be aware that this requires the GooglePlayServices to be installed on the user's
#### Android Notes:

> Google Play Services JAR Hell should not happen anymore since Appcelerator greatly improved this area with the introduction of ti.playservices.
If you get a google-play-services-base.jar conflict with other modules like ti.map, try removing the jar from one of the modules in order to solve it.
Due to the nature of Android AdvertisingIdClient implementation, the methods for fetching the ID cannot be called from the main thread and should be called on a separate AsyncTask. This sometimes causes a delay for reading the parameter as it must be called from a Google Play Services API (and probably makes some network connections behind). That said, the method will return the string: **processing** if the AsyncTask haven't returned yet.

Expand Down
12 changes: 0 additions & 12 deletions android/.classpath

This file was deleted.

22 changes: 0 additions & 22 deletions android/.idea/compiler.xml

This file was deleted.

3 changes: 0 additions & 3 deletions android/.idea/copyright/profiles_settings.xml

This file was deleted.

38 changes: 0 additions & 38 deletions android/.idea/misc.xml

This file was deleted.

8 changes: 0 additions & 8 deletions android/.idea/modules.xml

This file was deleted.

Loading

0 comments on commit a5c0b97

Please sign in to comment.