Skip to content

Commit 6104796

Browse files
authored
Merge pull request #124 from antonargunov/master
version 7.0.3
2 parents 9c3bb24 + 9aa5ce0 commit 6104796

File tree

9 files changed

+27
-14
lines changed

9 files changed

+27
-14
lines changed

Branch-Xamarin-Lib.iOS/ApiDefinition.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2769,13 +2769,13 @@ interface BranchEvent
27692769
BranchEventAdType AdType { get; set; }
27702770

27712771
// @property (copy, nonatomic) NSArray<BranchUniversalObject *> * _Nonnull contentItems;
2772-
[Export("contentItems", ArgumentSemantic.Copy)]
2772+
[Export("contentItems", ArgumentSemantic.Strong)]
27732773
//BranchUniversalObject[] ContentItems { get; set; }
2774-
NSMutableArray<NSObject> ContentItems { get; set; }
2774+
NSArray ContentItems { get; set; }
27752775

27762776
// @property (copy, nonatomic) NSDictionary<NSString *,NSString *> * _Nonnull customData;
2777-
[Export("customData", ArgumentSemantic.Copy)]
2778-
NSMutableDictionary<NSString, NSString> CustomData { get; set; }
2777+
[Export("customData", ArgumentSemantic.Strong)]
2778+
NSDictionary<NSString, NSString> CustomData { get; set; }
27792779

27802780
// -(void)logEvent;
27812781
[Export("logEvent")]

Branch-Xamarin-SDK.Droid/Resources/Resource.designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Branch-Xamarin-SDK.iOS/BranchIOSUtils.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,18 +354,26 @@ public static void SendEvent(BranchEvent e) {
354354
}
355355
if (eventDict.ContainsKey("custom_data")) {
356356
Dictionary<string, string> dict = eventDict[@"custom_data"] as Dictionary<string, string>;
357+
NSMutableDictionary<NSString, NSString> tempDict = new NSMutableDictionary<NSString, NSString>();
357358

358359
foreach(string key in dict.Keys) {
359-
branchEvent.CustomData.Add(new NSString(key), new NSString(dict[key]));
360+
tempDict.Add(new NSString(key), new NSString(dict[key]));
360361
}
362+
363+
branchEvent.CustomData = new NSDictionary<NSString, NSString>(tempDict.Keys, tempDict.Values);
361364
}
362365

363366
if (eventDict.ContainsKey("content_items")) {
364367
List<string> array = eventDict["content_items"] as List<string>;
368+
NSMutableDictionary<NSObject, NSObject> tempDict = new NSMutableDictionary<NSObject, NSObject>();
365369

370+
int i = 1;
366371
foreach (string buoJson in array) {
367-
branchEvent.ContentItems.Add(ToNativeUniversalObject(new BranchUniversalObject(buoJson)));
372+
tempDict.Add(NSObject.FromObject(i), ToNativeUniversalObject(new BranchUniversalObject(buoJson)));
373+
++i;
368374
}
375+
376+
branchEvent.ContentItems = NSArray.FromNSObjects<NSObject>(tempDict.Values);
369377
}
370378

371379
branchEvent.LogEvent();

Branch-Xamarin-SDK/Model/BranchUniversalObject.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ public void loadFromDictionary(Dictionary<string, object> data)
148148
{
149149
if (data["metadata"] != null)
150150
{
151-
Dictionary<string, object> metaTemp = data["metadata"] as Dictionary<string, object>;
151+
//Dictionary<string, object> metaTemp = data["metadata"] as Dictionary<string, object>;
152+
Dictionary<string, object> metaTemp = JsonConvert.DeserializeObject<Dictionary<string, object>>(data["metadata"] as string);
152153

153154
if (metaTemp != null)
154155
{

Branch-Xamarin-Testbed.Droid/Resources/Resource.designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Branch-Xamarin-Testbed.iOS/Branch-Xamarin-Testbed.iOS.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,14 @@
152152
<Project>{5F491888-E3EF-4A87-9296-75908B2DB31C}</Project>
153153
<Name>Branch-Xamarin-SDK</Name>
154154
</ProjectReference>
155-
<ProjectReference Include="..\Branch-Xamarin-SDK.iOS\Branch-Xamarin-SDK.iOS.csproj">
156-
<Project>{3F24A531-821D-4E9B-9776-31E19ABAF087}</Project>
157-
<Name>Branch-Xamarin-SDK.iOS</Name>
158-
</ProjectReference>
159155
<ProjectReference Include="..\Branch-Xamarin-Testbed\Branch-Xamarin-Testbed.csproj">
160156
<Project>{6CEB1D9B-7A7B-420E-8CA2-AAD59116F2A8}</Project>
161157
<Name>Branch-Xamarin-Testbed</Name>
162158
</ProjectReference>
159+
<ProjectReference Include="..\Branch-Xamarin-SDK.iOS\Branch-Xamarin-SDK.iOS.csproj">
160+
<Project>{3F24A531-821D-4E9B-9776-31E19ABAF087}</Project>
161+
<Name>Branch-Xamarin-SDK.iOS</Name>
162+
</ProjectReference>
163163
</ItemGroup>
164164
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
165165
</Project>

ChangeLog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
Branch Xamarin SDK change log
22

3+
- 7.0.3
4+
* Fixing InvalidCastException when adding custom data to branch event on IOS
5+
* Fixing empty content items in branch event on IOS
6+
37
- 7.0.2
48
* Supporting 'customer_event_alias' field
59

12.9 MB
Binary file not shown.

NuGet/Branch-Xamarin-SDK.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<id>Branch-Xamarin-Linking-SDK</id>
55
<title>Branch Xamarin SDK</title>
66
<summary>Hosted deep links for your Xamarin-based Android or iOS app by Branch</summary>
7-
<version>7.0.2</version>
7+
<version>7.0.3</version>
88
<authors>Branch Metrics, Inc.</authors>
99
<owners>Branch Metrics, Inc.</owners>
1010
<!-- <iconUrl> https://s3-us-west-1.amazonaws.com/branchhost/branch_icon.png</iconUrl> -->

0 commit comments

Comments
 (0)