Skip to content

Commit

Permalink
Updating Unity plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
Wenzhi committed Apr 13, 2017
1 parent a90d7da commit b2101ef
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 37 deletions.
4 changes: 0 additions & 4 deletions Assets/Plugins/Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@
</intent-filter>
</activity>

<activity android:name="com.appboy.ui.AppboyWebViewActivity" android:theme="@android:style/Theme" />

<activity android:name="com.appboy.ui.activities.AppboyFeedActivity" android:theme="@android:style/Theme" />

<activity android:name="com.appboy.unity.AppboyOverlayActivity" android:theme="@style/Appboy.Theme.Transparent" />

<receiver android:name="com.appboy.AppboyGcmReceiver" android:permission="com.google.android.c2dm.permission.SEND" >
Expand Down
Empty file modified Assets/Plugins/Android/libs/android-support-v4.aar
100644 → 100755
Empty file.
Binary file modified Assets/Plugins/Android/libs/appboy-ui.aar
100644 → 100755
Binary file not shown.
Binary file modified Assets/Plugins/Android/libs/appboy-unity.aar
100644 → 100755
Binary file not shown.
Binary file added Assets/Plugins/Android/libs/appboy.aar
Binary file not shown.
Binary file removed Assets/Plugins/Android/libs/appboy.jar
Binary file not shown.
10 changes: 9 additions & 1 deletion Assets/Plugins/Android/res/values/appboy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,27 @@
<resources>
<!-- General configuration -->
<string name="com_appboy_api_key">REPLACE_WITH_YOUR_APPBOY_API_KEY</string>
<string translatable="false" name="com_appboy_sdk_flavor">UNITY</string>

<!-- GCM Push Notification configuration (optional) -->
<bool name="com_appboy_push_gcm_messaging_registration_enabled">true</bool> <!-- Whether or not Appboy should handle registering the device to receive GCM push notifications. Default is false. -->
<string name="com_appboy_push_gcm_sender_id">REPLACE_WITH_YOUR_GCM_SENDER_ID</string> <!-- Replace with your gcm sender ID. The sender ID is your Google API project number. -->

<!-- ADM Push Notification configuration (optional) -->
<bool name="com_appboy_push_adm_messaging_registration_enabled">true</bool> <!-- Whether or not Appboy should handle registering the device to receive ADM push notifications. Default is false. -->


<!-- Push deep link configuration (optional) -->
<bool name="com_appboy_handle_push_deep_links_automatically">true</bool> <!-- Whether to open push deep links from Appboy automatically. -->

<!-- In-app message configuration (optional) -->
<bool name="com_appboy_inapp_show_inapp_messages_automatically">true</bool> <!-- Whether to display in-app messages from Appboy using the Appboy native UI. -->

<!-- Optional -->
<!-- <string name="com_appboy_inapp_listener_game_object_name"></string> --> <!-- The Unity game object to receive inapp messages. -->
<!-- <string name="com_appboy_inapp_listener_callback_method_name"></string> --> <!-- The callback method to be called when an inapp message is received. -->
<!-- <string name="com_appboy_feed_listener_game_object_name"></string> --> <!-- The Unity game object to receive the news feed. -->
<!-- <string name="com_appboy_feed_listener_callback_method_name"></string> --> <!-- The callback method to be called when the news feed is received. -->

<!--- Internal Appboy Usage -->
<string name="com_appboy_sdk_flavor">UNITY</string>
</resources>
22 changes: 0 additions & 22 deletions Assets/Plugins/Appboy/AppboyBinding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ void Start() {
[System.Runtime.InteropServices.DllImport("__Internal")]
private static extern void _setUserAvatarImageURL(string imageURL);

[System.Runtime.InteropServices.DllImport("__Internal")]
private static extern void _setUserBio(string bio);

[System.Runtime.InteropServices.DllImport("__Internal")]
private static extern void _setUserGender(int gender);

Expand All @@ -75,9 +72,6 @@ void Start() {
[System.Runtime.InteropServices.DllImport("__Internal")]
private static extern void _setUserHomeCity(string city);

[System.Runtime.InteropServices.DllImport("__Internal")]
private static extern void _setUserIsSubscribedToEmails(bool isSubscribedToEmails);

[System.Runtime.InteropServices.DllImport("__Internal")]
private static extern void _setUserEmailNotificationSubscriptionType(int emailNotificationSubscriptionType);

Expand Down Expand Up @@ -192,10 +186,6 @@ public static void SetUserLastName(string lastName) {
public static void SetUserEmail(string email) {
_setUserEmail(email);
}

public static void SetUserBio(string bio) {
_setUserBio(bio);
}

public static void SetUserGender(Gender gender) {
_setUserGender((int)gender);
Expand All @@ -213,10 +203,6 @@ public static void SetUserHomeCity(string city) {
_setUserHomeCity(city);
}

public static void SetUserIsSubscribedToEmails(bool isSubscribedToEmails) {
_setUserIsSubscribedToEmails(isSubscribedToEmails);
}

public static void SetUserEmailNotificationSubscriptionType(AppboyNotificationSubscriptionType emailNotificationSubscriptionType) {
_setUserEmailNotificationSubscriptionType((int)emailNotificationSubscriptionType);
}
Expand Down Expand Up @@ -448,10 +434,6 @@ public static void SetUserLastName(string lastName) {
public static void SetUserEmail(string email) {
GetCurrentUser().Call<bool>("setEmail", email);
}

public static void SetUserBio(string bio) {
GetCurrentUser().Call<bool>("setBio", bio);
}

/// <summary>
/// Sets the gender field for the current user.
Expand Down Expand Up @@ -543,10 +525,6 @@ public static void SetUserHomeCity(string city) {
GetCurrentUser().Call<bool>("setHomeCity", city);
}

public static void SetUserIsSubscribedToEmails(bool isSubscribedToEmails) {
GetCurrentUser().Call<bool>("setIsSubscribedToEmails", isSubscribedToEmails);
}

public static void SetUserEmailNotificationSubscriptionType(AppboyNotificationSubscriptionType emailNotificationSubscriptionType) {
using (var notificationTypeClass = new AndroidJavaClass("com.appboy.enums.NotificationSubscriptionType")) {
switch (emailNotificationSubscriptionType) {
Expand Down
4 changes: 3 additions & 1 deletion Assets/Plugins/Appboy/Editor/PostBuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ private static void ModifyProject(string projectPath) {
"AdSupport.framework",
"StoreKit.framework",
"CoreLocation.framework", // optional for location tracking
"ImageIO.framework" // required by SDWebImage
"ImageIO.framework", // required by SDWebImage
"MobileCoreServices.framework", // required by FLAnimatedImage
"CoreGraphics.framework" // required by FLAnimatedImage
};

foreach (string target in targets) {
Expand Down
3 changes: 2 additions & 1 deletion Assets/Plugins/iOS/AppboyAppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ - (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(N
// Initialize Appboy
[Appboy startWithApiKey:[[AppboyUnityManager sharedInstance] getApiKeyFromUnity]
inApplication:application
withLaunchOptions:launchOptions];
withLaunchOptions:launchOptions
withAppboyOptions:@{ABKSDKFlavorKey: @(UNITY)}];

// Set listeners
[[AppboyUnityManager sharedInstance] setListeners];
Expand Down
8 changes: 0 additions & 8 deletions Assets/Plugins/iOS/AppboyUnityManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ - (void) setUserEmail:(NSString *)email {
[Appboy sharedInstance].user.email = email;
}

- (void) setUserBio:(NSString *)bio {
[Appboy sharedInstance].user.bio = bio;
}

- (void) setUserGender:(NSInteger)gender {
[[Appboy sharedInstance].user setGender:(ABKUserGenderType)gender];
}
Expand All @@ -99,10 +95,6 @@ - (void) setUserHomeCity:(NSString *)city {
[Appboy sharedInstance].user.homeCity = city;
}

- (void) setUserIsSubscribedToEmails:(BOOL)subscribedToEmail {
[[Appboy sharedInstance].user setIsSubscribedToEmails:subscribedToEmail];
}

- (void) setUserEmailNotificationSubscriptionType:(NSInteger)emailNotificationSubscriptionType {
[[Appboy sharedInstance].user setEmailNotificationSubscriptionType:(ABKNotificationSubscriptionType)emailNotificationSubscriptionType];
}
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.11.0
* Updates the iOS plugin to use Appboy iOS SDK 2.29.0, which drops support for iOS 7.
* Updates the Android plugin to use Appboy Android SDK 2.0.0.
* Removes methods `SetUserIsSubscribedToEmails` and `SetUserBio` as they are removed in the Appboy native SDKs.

## 1.10.0
* Adds a new method `DisplayNextInAppMessage(bool withDelegate)` in iOS plugin to display next in-app message from the in-app message stack, if there is one.
* When the withDelegate is false, the in-app message will be displayed in Appboy's default UI. Otherwise, it will follow the normal in-app message displaying path by going through the `- (ABKInAppMessageDisplayChoice)beforeInAppMessageDisplayed:(ABKInAppMessage *)inAppMessage withKeyboardIsUp:(BOOL)keyboardIsUp` in `AppboyUnityManager.m`.
Expand Down
4 changes: 4 additions & 0 deletions scripts/generate_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

APPBOY_IOS_SDK="AppboyKit"
SD_WEB_IMAGE="SDWebImage.framework"
FL_ANIMATED_IMAGE="FLAnimatedImage.framework"
PROJECT_ROOT=$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )
LIBRARIES_PATH=$PROJECT_ROOT/Libraries
IOS_PLUGINS_PATH=$PROJECT_ROOT/Assets/Plugins/iOS
Expand All @@ -18,11 +19,14 @@ fi
echo "Deleting iOS libraries from Assets/Plugins/iOS/"
[ -e $IOS_PLUGINS_PATH/$APPBOY_IOS_SDK ] && rm -rf $IOS_PLUGINS_PATH/$APPBOY_IOS_SDK*
[ -e $IOS_PLUGINS_PATH/$SD_WEB_IMAGE ] && rm -rf $IOS_PLUGINS_PATH/$SD_WEB_IMAGE*
[ -e $IOS_PLUGINS_PATH/$FL_ANIMATED_IMAGE ] && rm -rf $IOS_PLUGINS_PATH/$FL_ANIMATED_IMAGE*


echo "Copying iOS libraries from Libraries/ to Assets/Plugins/iOS/"
cp -R $LIBRARIES_PATH/$APPBOY_IOS_SDK/ $IOS_PLUGINS_PATH/$APPBOY_IOS_SDK/ &
if [ "$EXCLUDE_DEPENDENCIES" = false ]; then
cp -R $LIBRARIES_PATH/$SD_WEB_IMAGE $IOS_PLUGINS_PATH/$SD_WEB_IMAGE
cp -R $LIBRARIES_PATH/$FL_ANIMATED_IMAGE $IOS_PLUGINS_PATH/$FL_ANIMATED_IMAGE
fi &
wait

Expand Down

0 comments on commit b2101ef

Please sign in to comment.