Skip to content

Commit

Permalink
Releasing Xamarin Bindings version 1.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Bucimis committed Apr 21, 2018
1 parent 6264050 commit 87743cb
Show file tree
Hide file tree
Showing 96 changed files with 607 additions and 271 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 1.5.1

##### Changed
- Updated the iOS binding to use Braze SDK version 3.3.4.
- Added `DisableSDK()` and `RequestEnableSDKOnNextAppRun()` to the `Appboy` interface to disable and re-enable the Braze SDK.
- Added `WipeDataAndDisableForAppRun()` on the `Appboy` interface to support wiping all customer data created by the Braze SDK.
- Note that methods that disable the SDK will cause `Appboy.SharedInstance` to return `null`. If you have code that uses `Appboy.SharedInstance`, do not use `DisableSDK()` or `WipeDataAndDisableForAppRun()` until your code can safely execute even if `Appboy.SharedInstance` is null.
- Updated the Android binding to use Braze SDK version 2.2.5.
- Added `DisableSdk()` and `EnableSdk()` to the `Appboy` interface to disable and re-enable the Braze SDK.
- Added `WipeData()` on the `Appboy` interface to support wiping all customer data created by the Braze SDK.

## 1.5

##### Breaking
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions appboy-component/nuget/AppboyPlatform.AndroidBinding.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
<package >
<metadata>
<id>AppboyPlatform.AndroidBinding</id>
<version>1.5.0</version>
<version>1.5.1</version>
<authors>Braze, Inc.</authors>
<owners>Braze, Inc.</owners>
<licenseUrl>https://github.com/Appboy/appboy-xamarin-bindings/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/Appboy/appboy-xamarin-bindings</projectUrl>
<iconUrl>https://github.com/Appboy/appboy-xamarin-bindings/blob/master/braze-logo.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Braze Xamarin Android Binding</description>
<releaseNotes>Initial Nuget release.</releaseNotes>
<releaseNotes></releaseNotes>
<copyright>Copyright 2018</copyright>
<tags>Braze Appboy</tags>
<dependencies>
Expand Down
4 changes: 2 additions & 2 deletions appboy-component/nuget/AppboyPlatformXamariniOSBinding.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
<package >
<metadata>
<id>AppboyPlatformXamariniOSBinding</id>
<version>1.5.0</version>
<version>1.5.1</version>
<authors>Braze</authors>
<owners>Braze</owners>
<licenseUrl>https://github.com/Appboy/appboy-xamarin-bindings/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/Appboy/appboy-xamarin-bindings</projectUrl>
<iconUrl>https://github.com/Appboy/appboy-xamarin-bindings/blob/master/braze-logo.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Braze Xamarin iOS Binding</description>
<releaseNotes>Initial Nuget release.</releaseNotes>
<releaseNotes></releaseNotes>
<copyright>Copyright 2018</copyright>
<tags>Braze Appboy</tags>
</metadata>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,21 @@ String profileImageUrl
view.FindViewById<Button> (Resource.Id.dataFlushButton).Click += delegate {
Appboy.GetInstance(Activity).RequestImmediateDataFlush();
};

// Wipe Data
view.FindViewById<Button> (Resource.Id.wipeDataButton).Click += delegate {
Appboy.WipeData(Activity);
};

// Disable SDK
view.FindViewById<Button> (Resource.Id.disableSDKButton).Click += delegate {
Appboy.DisableSdk(Activity);
};

// Enable SDK
view.FindViewById<Button> (Resource.Id.enableSDKButton).Click += delegate {
Appboy.EnableSdk(Activity);
};

return view;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.appboy.xamarinsample">
<uses-sdk android:minSdkVersion="9" />
<uses-sdk android:minSdkVersion="14" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,19 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/dataFlushButton" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/wipeDataButton"
android:text="Wipe Data" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/enableSDKButton"
android:text="Enable SDK" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/disableSDKButton"
android:text="Disable SDK" />
</LinearLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public override UIWindow Window {

public override void DidReceiveRemoteNotification(UIApplication application, NSDictionary userInfo, Action<UIBackgroundFetchResult> completionHandler)
{
Appboy.SharedInstance.RegisterApplicationWithFetchCompletionHandler(application, userInfo, completionHandler);
Appboy.SharedInstance?.RegisterApplicationWithFetchCompletionHandler(application, userInfo, completionHandler);
}

//
Expand All @@ -43,7 +43,9 @@ public override bool FinishedLaunching(UIApplication app, NSDictionary options)

// Start Appboy
Appboy.StartWithApiKey("09aa7156-9aef-4043-acfa-424d0dbc3d80", UIApplication.SharedApplication, options);
if (Appboy.SharedInstance != null) {
Appboy.SharedInstance.SdkFlavor = ABKSDKFlavor.Xamarin;
}

if (UIDevice.CurrentDevice.CheckSystemVersion(10, 0))
{
Expand All @@ -70,14 +72,14 @@ public override bool FinishedLaunching(UIApplication app, NSDictionary options)
public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
{
Console.WriteLine("Registered For Remote Notifications");
Appboy.SharedInstance.RegisterPushToken(deviceToken.ToString());
Appboy.SharedInstance?.RegisterPushToken(deviceToken.ToString());
}

private class UserNotificationsDelegate : UNUserNotificationCenterDelegate
{
public override void DidReceiveNotificationResponse(UNUserNotificationCenter center, UNNotificationResponse response, Action completionHandler)
{
Appboy.SharedInstance.UserNotificationCenter(center, response, completionHandler);
Appboy.SharedInstance?.UserNotificationCenter(center, response, completionHandler);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,66 +26,99 @@ public override void ViewDidLoad()
UserPropertyButton.TouchUpInside += UserPropertyButtonHandler;
EventsAndPurchasesButton.TouchUpInside += EventsAndPurchasesButtonHandler;
AddSlideupButton.TouchUpInside += AddSlideupButtonHandler;
ChangeUserLabel.Text = "Current User: " + Appboy.SharedInstance.User.UserID;
ChangeUserLabel.Text = "Current User: " + Appboy.SharedInstance?.User?.UserID;
}

private void ChangeUserButtonHandler(object sender, EventArgs e)
{
String userId = "myUserId" + new Random().Next(1, 10000);
Appboy.SharedInstance.ChangeUser(userId);
ChangeUserLabel.Text = "Current User: " + userId;
if (Appboy.SharedInstance != null)
{
String userId = "myUserId" + new Random().Next(1, 10000);
Appboy.SharedInstance.ChangeUser(userId);
ChangeUserLabel.Text = "Current User: " + userId;
}
}

private void UserPropertyButtonHandler(object sender, EventArgs e)
{
Appboy.SharedInstance.User.Country = "USA";
Appboy.SharedInstance.User.DateOfBirth = NSDate.Now;
Appboy.SharedInstance.User.Email = "[email protected]";
Appboy.SharedInstance.User.FirstName = "Brian";
Appboy.SharedInstance.User.HomeCity = "Belmar";
Appboy.SharedInstance.User.LastName = "Tester";
Appboy.SharedInstance.User.Phone = "5555555555";
Appboy.SharedInstance.User.SetCustomAttributeWithKey("customAttributeKey", true);
Appboy.SharedInstance.User.SetEmailNotificationSubscriptionType(ABKNotificationSubscriptionType.ABKOptedIn);
Appboy.SharedInstance.User.SetGender(ABKUserGenderType.Male);
Appboy.SharedInstance.User.AttributionData = new ABKAttributionData("n1", "c1", "a1", "cr1");
if (Appboy.SharedInstance != null)
{
Appboy.SharedInstance.User.Country = "USA";
Appboy.SharedInstance.User.DateOfBirth = NSDate.Now;
Appboy.SharedInstance.User.Email = "[email protected]";
Appboy.SharedInstance.User.FirstName = "Brian";
Appboy.SharedInstance.User.HomeCity = "Belmar";
Appboy.SharedInstance.User.LastName = "Tester";
Appboy.SharedInstance.User.Phone = "5555555555";
Appboy.SharedInstance.User.SetCustomAttributeWithKey("customAttributeKey", true);
Appboy.SharedInstance.User.SetEmailNotificationSubscriptionType(ABKNotificationSubscriptionType.ABKOptedIn);
Appboy.SharedInstance.User.SetGender(ABKUserGenderType.Male);
Appboy.SharedInstance.User.AttributionData = new ABKAttributionData("n1", "c1", "a1", "cr1");
}
}

private void EventsAndPurchasesButtonHandler(object sender, EventArgs e)
{
Appboy.SharedInstance.LogCustomEvent("myCustomEvent");
Appboy.SharedInstance.LogPurchase("myProduct", "USD", new NSDecimalNumber("10"));
Appboy.SharedInstance?.LogCustomEvent("myCustomEvent");
Appboy.SharedInstance?.LogPurchase("myProduct", "USD", new NSDecimalNumber("10"));
}

private void AddSlideupButtonHandler(object sender, EventArgs e)
{
Appboy.SharedInstance.InAppMessageController.Delegate = new ABKInAppMessageControllerDelegate();
ABKInAppMessageSlideup slideup = new ABKInAppMessageSlideup() {
Message = "This is a slideup",
Duration = 10
};
Appboy.SharedInstance.InAppMessageController.AddInAppMessage(slideup);
if (Appboy.SharedInstance != null)
{
Appboy.SharedInstance.InAppMessageController.Delegate = new ABKInAppMessageControllerDelegate();
ABKInAppMessageSlideup slideup = new ABKInAppMessageSlideup()
{
Message = "This is a slideup",
Duration = 10
};
Appboy.SharedInstance.InAppMessageController.AddInAppMessage(slideup);
}
}

partial void AddModalButton_TouchUpInside(UIButton sender)
{
Appboy.SharedInstance.InAppMessageController.Delegate = new ABKInAppMessageControllerDelegate();
ABKInAppMessageModal modal = new ABKInAppMessageModal() {
Message = "This is a modal",
Duration = 10
};
Appboy.SharedInstance.InAppMessageController.AddInAppMessage(modal);
if (Appboy.SharedInstance != null)
{
Appboy.SharedInstance.InAppMessageController.Delegate = new ABKInAppMessageControllerDelegate();
ABKInAppMessageModal modal = new ABKInAppMessageModal()
{
Message = "This is a modal",
Duration = 10
};
Appboy.SharedInstance.InAppMessageController.AddInAppMessage(modal);
}
}

partial void AddFullButton_TouchUpInside(UIButton sender)
{
Appboy.SharedInstance.InAppMessageController.Delegate = new ABKInAppMessageControllerDelegate();
ABKInAppMessageFull full = new ABKInAppMessageFull() {
Message = "This is a full",
Duration = 10,
ImageURI = new NSUrl("https://raw.githubusercontent.com/Appboy/appboy-xamarin-bindings/master/braze-logo.png")
};
Appboy.SharedInstance.InAppMessageController.AddInAppMessage(full);
if (Appboy.SharedInstance != null)
{
Appboy.SharedInstance.InAppMessageController.Delegate = new ABKInAppMessageControllerDelegate();
ABKInAppMessageFull full = new ABKInAppMessageFull()
{
Message = "This is a full",
Duration = 10,
ImageURI = new NSUrl("https://raw.githubusercontent.com/Appboy/appboy-xamarin-bindings/master/braze-logo.png")
};
Appboy.SharedInstance.InAppMessageController.AddInAppMessage(full);
}
}

partial void WipeData_TouchUpInside(UIButton sender)
{
Appboy.WipeDataAndDisableForAppRun();
}

partial void EnableSDK_TouchUpInside(UIButton sender)
{
Appboy.RequestEnableSDKOnNextAppRun();
}

partial void DisableSDK_TouchUpInside(UIButton sender)
{
Appboy.DisableSDK();
}
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 87743cb

Please sign in to comment.