Skip to content

Commit 1b2eab6

Browse files
authored
Merge pull request #118 from mixpanel/fixes-property-types
fix setGroup array properties
2 parents 1bdc5d5 + eea4318 commit 1b2eab6

File tree

2 files changed

+5
-21
lines changed

2 files changed

+5
-21
lines changed

Samples/MixpanelDemo/ios/MixpanelDemo.xcodeproj/project.pbxproj

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -468,20 +468,10 @@
468468
);
469469
inputPaths = (
470470
"${PODS_ROOT}/Target Support Files/Pods-MixpanelDemo/Pods-MixpanelDemo-resources.sh",
471-
"${PODS_ROOT}/Mixpanel-swift/Sources/MiniNotificationViewController.xib",
472-
"${PODS_ROOT}/Mixpanel-swift/Sources/placeholder-image.png",
473-
"${PODS_ROOT}/Mixpanel-swift/Sources/TakeoverNotificationViewController~ipad.xib",
474-
"${PODS_ROOT}/Mixpanel-swift/Sources/TakeoverNotificationViewController~iphonelandscape.xib",
475-
"${PODS_ROOT}/Mixpanel-swift/Sources/TakeoverNotificationViewController~iphoneportrait.xib",
476471
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle",
477472
);
478473
name = "[CP] Copy Pods Resources";
479474
outputPaths = (
480-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/MiniNotificationViewController.nib",
481-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/placeholder-image.png",
482-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/TakeoverNotificationViewController~ipad.nib",
483-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/TakeoverNotificationViewController~iphonelandscape.nib",
484-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/TakeoverNotificationViewController~iphoneportrait.nib",
485475
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle",
486476
);
487477
runOnlyForDeploymentPostprocessing = 0;
@@ -496,20 +486,10 @@
496486
);
497487
inputPaths = (
498488
"${PODS_ROOT}/Target Support Files/Pods-MixpanelDemo-MixpanelDemoTests/Pods-MixpanelDemo-MixpanelDemoTests-resources.sh",
499-
"${PODS_ROOT}/Mixpanel-swift/Sources/MiniNotificationViewController.xib",
500-
"${PODS_ROOT}/Mixpanel-swift/Sources/placeholder-image.png",
501-
"${PODS_ROOT}/Mixpanel-swift/Sources/TakeoverNotificationViewController~ipad.xib",
502-
"${PODS_ROOT}/Mixpanel-swift/Sources/TakeoverNotificationViewController~iphonelandscape.xib",
503-
"${PODS_ROOT}/Mixpanel-swift/Sources/TakeoverNotificationViewController~iphoneportrait.xib",
504489
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle",
505490
);
506491
name = "[CP] Copy Pods Resources";
507492
outputPaths = (
508-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/MiniNotificationViewController.nib",
509-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/placeholder-image.png",
510-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/TakeoverNotificationViewController~ipad.nib",
511-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/TakeoverNotificationViewController~iphonelandscape.nib",
512-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/TakeoverNotificationViewController~iphoneportrait.nib",
513493
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle",
514494
);
515495
runOnlyForDeploymentPostprocessing = 0;

ios/MixpanelReactNative.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,11 @@ open class MixpanelReactNative: NSObject {
312312
resolver resolve: RCTPromiseResolveBlock,
313313
rejecter reject: RCTPromiseRejectBlock) -> Void {
314314
let instance = MixpanelReactNative.getMixpanelInstance(token)
315-
instance?.setGroup(groupKey: groupKey, groupID: MixpanelTypeHandler.mixpanelTypeValue(groupID)!)
315+
if groupID is Array<Any> {
316+
instance?.setGroup(groupKey: groupKey, groupIDs:MixpanelTypeHandler.mixpanelTypeValue(groupID)! as! [MixpanelType])
317+
} else {
318+
instance?.setGroup(groupKey: groupKey, groupID:MixpanelTypeHandler.mixpanelTypeValue(groupID)!)
319+
}
316320
resolve(nil)
317321
}
318322

0 commit comments

Comments
 (0)