Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
30 changes: 30 additions & 0 deletions .github/workflows/macOS.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Mixpanel Swift SDK action

on:
push:
branches: [ master, 3.0.0.beta ]
pull_request:
branches: [ master, 3.0.0.beta ]

jobs:
build:
runs-on: macos-latest

steps:
- uses: actions/checkout@v2
- name: Install Dependencies
working-directory: MixpanelDemo
run:
pod install --repo-update
- name: Swift Lint
run: swiftlint
- name: Run Test
working-directory: MixpanelDemo
run: |
set -o pipefail
xcodebuild -workspace MixpanelDemo.xcworkspace -scheme MixpanelDemoMac -derivedDataPath Build/ -configuration Debug ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES -enableCodeCoverage YES clean build test | xcpretty -c;
- name: Code Coverage Report
working-directory: MixpanelDemo/build/Logs/Test
run: |
xcrun xccov view --report --files-for-target Mixpanel.framework *.xcresult
xcrun xccov view --report --only-targets *.xcresult
544 changes: 540 additions & 4 deletions MixpanelDemo/MixpanelDemo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1250"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8654F2C3266ED84F00ACEED5"
BuildableName = "MixpanelDemoMac.app"
BlueprintName = "MixpanelDemoMac"
ReferencedContainer = "container:MixpanelDemo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
disableMainThreadChecker = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8654F2D4266ED85300ACEED5"
BuildableName = "MixpanelDemoMacTests.xctest"
BlueprintName = "MixpanelDemoMacTests"
ReferencedContainer = "container:MixpanelDemo.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8654F2C3266ED84F00ACEED5"
BuildableName = "MixpanelDemoMac.app"
BlueprintName = "MixpanelDemoMac"
ReferencedContainer = "container:MixpanelDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8654F2C3266ED84F00ACEED5"
BuildableName = "MixpanelDemoMac.app"
BlueprintName = "MixpanelDemoMac"
ReferencedContainer = "container:MixpanelDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,16 @@
allowLocationSimulation = "YES"
launchAutomaticallySubstyle = "8"
notificationPayloadFile = "MixpanelDemoWatch Extension/PushNotificationPayload.apns">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/MixpanelDemo">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "86F86E8A22440C5C00B69832"
BuildableName = "MixpanelDemoWatch.app"
BlueprintName = "MixpanelDemoWatch"
ReferencedContainer = "container:MixpanelDemo.xcodeproj">
</BuildableReference>
</RemoteRunnable>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand All @@ -77,27 +75,16 @@
debugDocumentVersioning = "YES"
launchAutomaticallySubstyle = "8"
notificationPayloadFile = "MixpanelDemoWatch Extension/PushNotificationPayload.apns">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/MixpanelDemo">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "86F86E8A22440C5C00B69832"
BuildableName = "MixpanelDemoWatch.app"
BlueprintName = "MixpanelDemoWatch"
ReferencedContainer = "container:MixpanelDemo.xcodeproj">
</BuildableReference>
</RemoteRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "86F86E8A22440C5C00B69832"
BuildableName = "MixpanelDemoWatch.app"
BlueprintName = "MixpanelDemoWatch"
ReferencedContainer = "container:MixpanelDemo.xcodeproj">
</BuildableReference>
</MacroExpansion>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,46 +55,33 @@
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
notificationPayloadFile = "MixpanelDemoWatch Extension/PushNotificationPayload.apns">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/MixpanelDemo">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "86F86E8A22440C5C00B69832"
BuildableName = "MixpanelDemoWatch.app"
BlueprintName = "MixpanelDemoWatch"
ReferencedContainer = "container:MixpanelDemo.xcodeproj">
</BuildableReference>
</RemoteRunnable>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/MixpanelDemo">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "86F86E8A22440C5C00B69832"
BuildableName = "MixpanelDemoWatch.app"
BlueprintName = "MixpanelDemoWatch"
ReferencedContainer = "container:MixpanelDemo.xcodeproj">
</BuildableReference>
</RemoteRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "86F86E8A22440C5C00B69832"
BuildableName = "MixpanelDemoWatch.app"
BlueprintName = "MixpanelDemoWatch"
ReferencedContainer = "container:MixpanelDemo.xcodeproj">
</BuildableReference>
</MacroExpansion>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
Expand Down
35 changes: 35 additions & 0 deletions MixpanelDemo/MixpanelDemoMac/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//
// AppDelegate.swift
// MixpanelDemoMac
//
// Created by ZIHE JIA on 6/7/21.
// Copyright © 2021 Mixpanel. All rights reserved.
//

import Cocoa
import Mixpanel

@main
class AppDelegate: NSObject, NSApplicationDelegate {




func applicationDidFinishLaunching(_ aNotification: Notification) {
// Insert code here to initialize your application

var ADD_YOUR_MIXPANEL_TOKEN_BELOW_🛠🛠🛠🛠🛠🛠: String

Mixpanel.initialize(token: "MIXPANEL_TOKEN")
Mixpanel.mainInstance().loggingEnabled = true
Mixpanel.mainInstance().track(event: "Tracked Event")

}

func applicationWillTerminate(_ aNotification: Notification) {
// Insert code here to tear down your application
}


}

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"images" : [
{
"idiom" : "mac",
"scale" : "1x",
"size" : "16x16"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "16x16"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "32x32"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "32x32"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "128x128"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "128x128"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "256x256"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "256x256"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "512x512"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "512x512"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
6 changes: 6 additions & 0 deletions MixpanelDemo/MixpanelDemoMac/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading