Skip to content

Commit

Permalink
[MB-2054] Update to Android 8.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
hcrowell committed Dec 7, 2016
1 parent 14c35d5 commit e3c44a8
Show file tree
Hide file tree
Showing 15 changed files with 119 additions and 44 deletions.
4 changes: 3 additions & 1 deletion README.md
Expand Up @@ -3,7 +3,9 @@
Titanium module for Urban Airship services.

[ ![Download](https://api.bintray.com/packages/urbanairship/titanium/titanium-module/images/download.svg) ](https://bintray.com/urbanairship/titanium/titanium-module/_latestVersion)


Note: For Version 3.1.0 a special Urban Airship SDK build targeting version 23 was used to work around the issue where the v4 support library has not been updated for version 24+.

## Docs
- [Plugin](documentation/index.md)
- [Changelog](documentation/CHANGELOG.md)
Expand Down
Binary file modified android/lib/google-play-services-base.jar
Binary file not shown.
Binary file modified android/lib/google-play-services-gcm.jar
Binary file not shown.
Binary file added android/lib/google-play-services-iid.jar
Binary file not shown.
Binary file removed android/lib/urbanairship-sdk-7.2.0.jar
Binary file not shown.
Binary file added android/lib/urbanairship-sdk-8.2.1-special.jar
Binary file not shown.
5 changes: 2 additions & 3 deletions android/platform/android/res/layout-v14/ua_fragment_mc.xml
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>

<fragment
android:id="@+id/message_list_fragment"
android:name="com.urbanairship.messagecenter.MessageListFragment"
<FrameLayout
android:id="@+id/message_list_container"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
Expand Down
Expand Up @@ -7,6 +7,7 @@
android:id="@android:id/empty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/ua_message_not_selected"
android:layout_gravity="center" />

</FrameLayout>
Expand Up @@ -9,12 +9,10 @@
android:showDividers="middle"
xmlns:android="http://schemas.android.com/apk/res/android">

<fragment
android:id="@+id/message_list_fragment"
android:name="com.urbanairship.messagecenter.MessageListFragment"
<FrameLayout
android:id="@+id/message_list_container"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="300dp"

android:layout_height="match_parent"/>

<FrameLayout
Expand Down
51 changes: 30 additions & 21 deletions android/platform/android/res/layout/ua_activity_landing_page.xml
@@ -1,17 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.urbanairship.actions.LandingPageActivity"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="32dp"
android:paddingBottom="32dp"
android:paddingRight="16dp"
android:paddingTop="16dp"
tools:context="com.urbanairship.actions.LandingPageActivity">


<FrameLayout
android:layout_margin="16dp"
android:fitsSystemWindows="true"
android:id="@+id/content_holder"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
android:layout_height="fill_parent"
android:layout_gravity="center">

<!-- Layout must contain a UAWebView with id @android:id/primary -->
<com.urbanairship.widget.UAWebView
android:layout_marginTop="16dp"
android:layout_marginRight="16dp"
android:id="@android:id/primary"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
Expand All @@ -23,19 +32,19 @@
android:layout_height="wrap_content"
android:layout_gravity="center"/>

</FrameLayout>
<!-- Optional close button -->
<ImageButton
android:id="@+id/close_button"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_gravity="right|top"
android:background="@null"
android:contentDescription="@android:string/ok"
android:onClick="onCloseButtonClick"
android:padding="8dp"
android:src="@drawable/ua_ic_close"
tools:ignore="OnClick"/>

<!-- Optional close button -->
<ImageButton
android:id="@+id/close_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:src="@drawable/ua_ic_close"
android:contentDescription="@android:string/ok"
android:background="@null"
tools:ignore="OnClick"
android:onClick="onCloseButtonClick"/>
</FrameLayout>

</RelativeLayout>
</FrameLayout>
57 changes: 57 additions & 0 deletions android/platform/android/res/raw/ua_native_bridge
@@ -0,0 +1,57 @@
if (typeof UAirship === 'undefined') {
UAirship = (function() {
var urbanAirship = (typeof _UAirship === 'object') ? Object.create(_UAirship) : {}

var actionCallbacks = {}
, callbackID = 0

function invoke(url) {
var f = document.createElement('iframe')
f.style.display = 'none'
f.src = url

document.body.appendChild(f)
f.parentNode.removeChild(f)
}

urbanAirship.close = function() {
invoke('uairship://close')
}

urbanAirship.runAction = function(actionName, argument, callback) {
var callbackKey = 'ua-cb-' + (++callbackID)

actionCallbacks[callbackKey] = function(err, data) {
if (!callback) {
return;
}

if(err) {
callback(err)
} else {
callback(null, data)
}
}

var encodedArgument = encodeURIComponent(JSON.stringify(argument))
invoke('uairship://android-run-action-cb/' + actionName + '/' + encodedArgument + '/' + callbackKey)
}

urbanAirship.finishAction = function(err, data, callbackKey) {
if(actionCallbacks[callbackKey]) {
actionCallbacks[callbackKey](err, data)
delete actionCallbacks[callbackKey]
}
}

return urbanAirship
})()

// Fire the ready event
var uaLibraryReadyEvent = document.createEvent('Event')

uaLibraryReadyEvent.initEvent('ualibraryready', true, true)
document.dispatchEvent(uaLibraryReadyEvent)

UAirship.isReady = true
}
1 change: 0 additions & 1 deletion android/platform/android/res/values-v21/values-v21.xml
Expand Up @@ -5,7 +5,6 @@
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowNoTitle">true</item>
<item name="android:padding">8dp</item>
<item name="android:windowTranslucentStatus">true</item>
</style>
<style name="Widget.UrbanAirship.InAppMessage.Banner" parent="Base.Widget.UrbanAirship.InAppMessage.Banner">
Expand Down
14 changes: 11 additions & 3 deletions android/platform/android/res/values/values.xml
@@ -1,7 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:ns1="urn:oasis:names:tc:xliff:document:1.2">
<color name="urban_airship_blue">#003f61</color>
<declare-styleable name="UAWebView"><attr format="enum" name="mixed_content_mode"><enum name="always_allow" value="0"/><enum name="never_allow" value="1"/><enum name="compatibility_mode" value="2"/></attr></declare-styleable>
<declare-styleable name="UAWebView"><attr format="enum" name="mixed_content_mode">

<enum name="always_allow" value="0"/>


<enum name="never_allow" value="1"/>


<enum name="compatibility_mode" value="2"/>
</attr></declare-styleable>
<declare-styleable name="UrbanAirshipActionButton"><attr name="android:icon"/><attr name="android:label"/></declare-styleable>
<plurals name="ua_selected_count">
<item quantity="one"><ns1:g example="1" id="count">%1$d</ns1:g> selected</item>
Expand All @@ -16,7 +25,7 @@
<string name="ua_mark_read">Mark Read</string>
<string name="ua_mc_failed_to_load">Unable to load message. Please try again later.</string>
<string name="ua_message_center_title">Message Center</string>
<string name="ua_message_not_selected">No Message Selected</string>
<string name="ua_message_not_selected">No Messages Selected</string>
<string name="ua_notification_button_accept">Accept</string>
<string name="ua_notification_button_add">Add</string>
<string name="ua_notification_button_add_to_calendar">Add To Calendar</string>
Expand Down Expand Up @@ -53,6 +62,5 @@
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowNoTitle">true</item>
<item name="android:padding">8dp</item>
</style>
</resources>
10 changes: 8 additions & 2 deletions android/src/com/urbanairship/ti/TiAirshipReceiver.java
Expand Up @@ -18,8 +18,14 @@ public class TiAirshipReceiver extends AirshipReceiver {
private static final String TAG = "TiAirshipReceiver";

@Override
protected void onChannelRegistrationSucceeded(Context context, String channelId) {
Log.i(TAG, "Channel registration updated. Channel Id:" + channelId + ".");
protected void onChannelCreated(Context context, String channelId) {
Log.i(TAG, "Channel created. Channel ID:" + channelId + ".");
UrbanAirshipModule.onChannelUpdated(channelId);
}

@Override
protected void onChannelUpdated(Context context, String channelId) {
Log.i(TAG, "Channel updated. Channel ID:" + channelId + ".");
UrbanAirshipModule.onChannelUpdated(channelId);
}

Expand Down
14 changes: 5 additions & 9 deletions android/timodule.xml
Expand Up @@ -46,14 +46,14 @@

<!-- Google Play Services -->
<meta-data android:name="com.google.android.gms.version"
android:value="7571000"/>
android:value="9683000"/>

<!-- ADM -->
<amazon:enable-feature
android:name="com.amazon.device.messaging"
android:required="false"/>

<activity android:name="com.urbanairship.actions.ActionActivity"
<activity android:name="com.urbanairship.util.HelperActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
<activity android:name="com.urbanairship.CoreActivity"/>
<activity android:name="com.urbanairship.google.PlayServicesErrorActivity"
Expand Down Expand Up @@ -89,19 +89,15 @@

</activity>

<service android:name="com.urbanairship.push.PushService"
android:label="Push Notification Service"/>
<service android:name="com.urbanairship.analytics.EventService"
android:label="Event Service"/>
<service android:name="com.urbanairship.AirshipService"/>
<service android:name="com.urbanairship.actions.ActionService"/>
<service android:name="com.urbanairship.richpush.RichPushUpdateService"/>
<service android:name="com.urbanairship.location.LocationService"
android:label="Segments Service"/>

<service
android:name="com.urbanairship.push.UAInstanceIDListenerService"
android:exported="false">
<intent-filter>
<intent-filter android:priority="-999">
<action android:name="com.google.android.gms.iid.InstanceID"/>
</intent-filter>
</service>
Expand All @@ -119,7 +115,7 @@
android:name="com.urbanairship.push.GcmPushReceiver"
android:permission="com.google.android.c2dm.permission.SEND">

<intent-filter>
<intent-filter android:priority="-999">
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
<action android:name="com.google.android.c2dm.intent.REGISTRATION"/>
<category android:name="${tiapp.properties['id']}"/>
Expand Down

0 comments on commit e3c44a8

Please sign in to comment.