Skip to content

Commit

Permalink
Updating Unity plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
Bucimis committed Aug 29, 2018
1 parent ab94961 commit 3df22cb
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 2 deletions.
3 changes: 1 addition & 2 deletions Assets/Plugins/Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@

<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" >
<receiver android:name="com.appboy.AppboyFcmReceiver" android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="REPLACE_WITH_YOUR_BUNDLE_IDENTIFIER" />
</intent-filter>
</receiver>
Expand Down
Binary file modified Assets/Plugins/Android/libs/appboy-ui.aar
Binary file not shown.
Binary file modified Assets/Plugins/Android/libs/appboy-unity.aar
Binary file not shown.
Binary file modified Assets/Plugins/Android/libs/appboy.aar
Binary file not shown.
15 changes: 15 additions & 0 deletions Assets/Plugins/Appboy/AppboyBinding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ void Start() {
[System.Runtime.InteropServices.DllImport("__Internal")]
private static extern void _disableSDK();

[System.Runtime.InteropServices.DllImport("__Internal")]
private static extern void _setAttributionData(string network, string campaign, string adgroup, string creative);

public static void LogCustomEvent(string eventName) {
_logCustomEvent(eventName, null);
}
Expand Down Expand Up @@ -341,6 +344,10 @@ public static string GetInstallTrackingId() {
return null;
}

public static void SetAttributionData(string network, string campaign, string adgroup, string creative) {
_setAttributionData(network, campaign, adgroup, creative);
}

#elif UNITY_ANDROID
private static AndroidJavaObject appboyUnityActivity;
private static AndroidJavaObject appboy;
Expand Down Expand Up @@ -746,6 +753,11 @@ public static string GetInstallTrackingId() {
return Appboy.Call<string>("getInstallTrackingId");
}

public static void SetAttributionData(string network, string campaign, string adgroup, string creative) {
var attributionData = new AndroidJavaObject("com.appboy.models.outgoing.AttributionData", network, campaign, adgroup, creative);
GetCurrentUser().Call<bool>("setAttributionData", attributionData);
}

#else

// Empty implementations of the API, in case the application is being compiled for a platform other than iOS or Android.
Expand Down Expand Up @@ -886,6 +898,9 @@ public static void DisableSDK() {
public static string GetInstallTrackingId() {
return null;
}

public static void SetAttributionData(string network, string campaign, string adgroup, string creative) {
}
#endif
}
}
4 changes: 4 additions & 0 deletions Assets/Plugins/iOS/AppboyBinding.m
Original file line number Diff line number Diff line change
Expand Up @@ -213,3 +213,7 @@ void _enableSDK() {
void _disableSDK() {
[AppboyUnityManager disableSDK];
}

void _setAttributionData(const char* network, const char* campaign,const char* adgroup, const char* creative) {
[[AppboyUnityManager sharedInstance] setAttributionData:GetStringParam(network) campaign:GetStringParam(campaign) adgroup:GetStringParam(adgroup) creative:GetStringParam(creative)];
}
1 change: 1 addition & 0 deletions Assets/Plugins/iOS/AppboyUnityManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ static NSString *const ABKUnityHandleInAppMessageDisplayKey = @"DisplayInAppMess
- (void) setCustomAttributeArrayWithKey:(NSString *)key array:(NSArray *)valueArray;
- (void) addToCustomAttributeArrayWithKey:(NSString *)key value:(NSString *)value;
- (void) removeFromCustomAttributeArrayWithKey:(NSString *)key value:(NSString *)value;
- (void) setAttributionData:(NSString *)network campaign:(NSString *)campaign adgroup:(NSString *)adgroup creative:(NSString *)creative;
- (void) setUserFacebookData:(NSString *)facebookId firstName:(NSString *)firstName lastName:(NSString *)lastName email:(NSString *)email bio:(NSString *)bio cityName:(NSString *)cityName gender:(NSInteger)gender numberOfFriends:(NSInteger)numberOfFriends birthday:(NSString *)birthday;
- (void) setUserTwitterData:(NSInteger)twitterUserId twitterHandle:(NSString *)twitterHandle name:(NSString *)name description:(NSString *)description followerCount:(NSInteger)followerCount followingCount:(NSInteger)followingCount tweetCount:(NSInteger)tweetCount profileImageUrl:(NSString *)profileImageUrl;
- (BOOL) submitFeedback:(NSString *)replyToEmail message:(NSString *)message isReportingABug:(BOOL)isReportingABug;
Expand Down
9 changes: 9 additions & 0 deletions Assets/Plugins/iOS/AppboyUnityManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,15 @@ - (void) removeFromCustomAttributeArrayWithKey:(NSString *)key value:(NSString *
[[Appboy sharedInstance].user removeFromCustomAttributeArrayWithKey:key value:value];
}

- (void) setAttributionData:(NSString *)network campaign:(NSString *)campaign adgroup:(NSString *)adgroup creative:(NSString *)creative {
ABKAttributionData *attributionData = [[ABKAttributionData alloc]
initWithNetwork:network
campaign:campaign
adGroup:adgroup
creative:creative];
[[Appboy sharedInstance].user setAttributionData:attributionData];
}

- (void) setUserFacebookData:(NSString *)facebookId firstName:(NSString *)firstName lastName:(NSString *)lastName email:(NSString *)email bio:(NSString *)bio cityName:(NSString *)cityName gender:(NSInteger)gender numberOfFriends:(NSInteger)numberOfFriends birthday:(NSString *)birthday {
NSMutableDictionary *facebookData = [NSMutableDictionary dictionary];
facebookData[@"id"] = facebookId;
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## 1.15.0

##### Breaking
- Updated the Android plugin to use [Braze Android SDK 2.7.0](https://github.com/Appboy/appboy-android-sdk/blob/master/CHANGELOG.md#270).
- __Important:__ Note that in Braze Android SDK 2.7.0, `AppboyGcmReceiver` was renamed to `AppboyFcmReceiver`. This receiver is intended to be used for Firebase integrations. Please update the `AppboyGcmReceiver` declaration in your `AndroidManifest.xml` to reference `AppboyFcmReceiver` and remove the `com.google.android.c2dm.intent.REGISTRATION` intent filter action.

##### Added
- Added `SetAttributionData` to the Appboy interface.

## 1.14.0

##### Breaking
Expand Down

0 comments on commit 3df22cb

Please sign in to comment.