Skip to content

Commit 0c76b1d

Browse files
authored
feat: add OSX desktop support (#220)
1 parent 631a6ec commit 0c76b1d

56 files changed

Lines changed: 2591 additions & 868 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/context/architecture/ARCHITECTURE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ Mixpanel Servers
225225
## Platform Dependencies
226226

227227
- **Android**: Mixpanel Android SDK v8.0.3
228-
- **iOS**: Mixpanel-swift v5.0.0
228+
- **iOS**: Mixpanel-swift 6.1.0
229+
- **macOS**: Mixpanel-swift 6.1.0
229230
- **Web**: Mixpanel JavaScript library (loaded from CDN)
230231

231232
## Example Usage

.claude/context/architecture/system-design.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The Mixpanel Flutter SDK implements a federated plugin architecture that provide
2727
│ - Type conversion │ - Type handler│ - safeJsify() │
2828
├─────────────────────┼───────────────┼──────────────────────┤
2929
│ Mixpanel Android │ Mixpanel-swift│ Mixpanel JS │
30-
│ SDK v8.0.3 │ SDK v5.0.0 │ (CDN loaded) │
30+
│ SDK v8.0.3 │ SDK v6.1.0 │ (CDN loaded) │
3131
└─────────────────────┴───────────────┴──────────────────────┘
3232
3333
Mixpanel Analytics Servers

.claude/context/codebase-map.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ mixpanel-flutter/
7575
7676
- **ios/mixpanel_flutter.podspec**: iOS pod configuration
7777
- iOS deployment target: 12.0
78-
- Mixpanel-swift dependency: ~> 5.1.0
78+
- Mixpanel-swift dependency: 6.1.0
7979
- Swift version: 5.0
8080
8181
- **analysis_options.yaml**: Dart static analysis rules
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Inlined from subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e (v2.21.0)
2+
# to avoid its unpinned transitive use of actions/cache@v4
3+
name: Set up Flutter
4+
description: Setup Flutter SDK with optional caching (all action refs pinned to SHA)
5+
6+
inputs:
7+
channel:
8+
description: The Flutter build release channel
9+
required: false
10+
default: stable
11+
flutter-version:
12+
description: The Flutter version to make available on the path
13+
required: false
14+
default: ""
15+
cache:
16+
description: Cache the Flutter SDK and pub dependencies
17+
required: false
18+
default: "true"
19+
20+
runs:
21+
using: composite
22+
steps:
23+
- name: Download flutter-action setup script
24+
shell: bash
25+
run: |
26+
curl -sSL -o "$RUNNER_TEMP/flutter-setup.sh" \
27+
"https://raw.githubusercontent.com/subosito/flutter-action/fd55f4c5af5b953cc57a2be44cb082c8f6635e8e/setup.sh"
28+
chmod +x "$RUNNER_TEMP/flutter-setup.sh"
29+
30+
- name: Resolve Flutter version and cache keys
31+
id: flutter-action
32+
shell: bash
33+
run: |
34+
"$RUNNER_TEMP/flutter-setup.sh" -p \
35+
-n '${{ inputs.flutter-version }}' \
36+
-a '${{ runner.arch }}' \
37+
${{ inputs.channel }}
38+
39+
- name: Cache Flutter SDK
40+
if: ${{ inputs.cache == 'true' }}
41+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
42+
with:
43+
path: ${{ steps.flutter-action.outputs.CACHE-PATH }}
44+
key: ${{ steps.flutter-action.outputs.CACHE-KEY }}
45+
46+
- name: Cache pub dependencies
47+
if: ${{ inputs.cache == 'true' }}
48+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
49+
with:
50+
path: ${{ steps.flutter-action.outputs.PUB-CACHE-PATH }}
51+
key: ${{ steps.flutter-action.outputs.PUB-CACHE-KEY }}-${{ hashFiles('**/pubspec.lock') }}
52+
53+
- name: Install Flutter SDK
54+
shell: bash
55+
run: |
56+
"$RUNNER_TEMP/flutter-setup.sh" \
57+
-n '${{ steps.flutter-action.outputs.VERSION }}' \
58+
-a '${{ steps.flutter-action.outputs.ARCHITECTURE }}' \
59+
-c '${{ steps.flutter-action.outputs.CACHE-PATH }}' \
60+
-d '${{ steps.flutter-action.outputs.PUB-CACHE-PATH }}' \
61+
${{ steps.flutter-action.outputs.CHANNEL }}

.github/copilot-instructions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ android/
7272
└── MixpanelFlutterHelper.java # Validation helpers
7373
7474
ios/
75-
├── mixpanel_flutter.podspec # iOS package (Mixpanel-swift 5.1.0)
75+
├── mixpanel_flutter.podspec # iOS package (Mixpanel-swift 6.1.0)
7676
└── Classes/
7777
├── SwiftMixpanelFlutterPlugin.swift # iOS platform channel
7878
└── MixpanelTypeHandler.swift # Type serialization
@@ -214,7 +214,7 @@ When adding a new SDK method:
214214

215215
**Production**:
216216
- Mixpanel Android SDK 8.2.0 (in `android/build.gradle`)
217-
- Mixpanel-swift 5.1.0 (in `ios/mixpanel_flutter.podspec`)
217+
- Mixpanel-swift 6.1.0 (in `ios/mixpanel_flutter.podspec` and `macos/mixpanel_flutter.podspec`)
218218
- Mixpanel JS (loaded from CDN in web/index.html)
219219

220220
**Dev**:

.github/workflows/flutter.yml

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ on:
66
pull_request:
77
branches: [main]
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
test-main-code:
1114
runs-on: macos-latest
1215
steps:
13-
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2
14-
- uses: actions/setup-java@b6e674f4b717d7b0ae3baee0fbe79f498905dfde # v1
15-
with:
16-
java-version: "12.x"
17-
- uses: subosito/flutter-action@4389e6cbc6cb8a4b18c628ff96ff90be0e926aa8 # v1
16+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
17+
- uses: ./.github/actions/setup-flutter
1818
with:
19-
flutter-version: "3.16.0"
19+
flutter-version: "3.41.0"
2020
- run: flutter pub get
2121
- run: flutter test
2222
- run: flutter analyze --no-pub --no-current-package --no-fatal-infos lib
@@ -29,9 +29,9 @@ jobs:
2929
with:
3030
java-version: "17"
3131
distribution: 'temurin'
32-
- uses: subosito/flutter-action@4389e6cbc6cb8a4b18c628ff96ff90be0e926aa8 # v1
32+
- uses: ./.github/actions/setup-flutter
3333
with:
34-
flutter-version: "3.16.0"
34+
flutter-version: "3.41.0"
3535
- name: Test Android integration
3636
working-directory: example
3737
run: flutter build apk
@@ -44,9 +44,9 @@ jobs:
4444
with:
4545
java-version: "17"
4646
distribution: 'temurin'
47-
- uses: subosito/flutter-action@4389e6cbc6cb8a4b18c628ff96ff90be0e926aa8 # v1
47+
- uses: ./.github/actions/setup-flutter
4848
with:
49-
flutter-version: "3.16.0"
49+
flutter-version: "3.41.0"
5050
- name: Clean
5151
working-directory: example
5252
run: flutter clean
@@ -59,3 +59,23 @@ jobs:
5959
- name: Test iOS integration
6060
working-directory: example
6161
run: flutter build ios --debug --simulator --no-codesign
62+
63+
test-macos-integration:
64+
runs-on: macos-26
65+
steps:
66+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
67+
- uses: ./.github/actions/setup-flutter
68+
with:
69+
flutter-version: "3.41.0"
70+
- name: Clean
71+
working-directory: example
72+
run: flutter clean
73+
- name: Flutter pub get
74+
working-directory: example
75+
run: flutter pub get
76+
- name: CocoaPods update
77+
working-directory: example/macos
78+
run: pod repo update
79+
- name: Test macOS integration
80+
working-directory: example
81+
run: flutter build macos --debug

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This is the official Mixpanel Flutter SDK - a Flutter plugin providing analytics
1111
### Key Technologies
1212
- **Flutter/Dart**: Core SDK implementation
1313
- **Platform Channels**: Communication between Dart and native code
14-
- **Native SDKs**: Mixpanel-Android (v8.0.3), Mixpanel-Swift (v5.0.0), Mixpanel-JS (CDN)
14+
- **Native SDKs**: Mixpanel-Android (v8.0.3), Mixpanel-Swift (6.1.0), Mixpanel-JS (CDN)
1515
- **Custom Serialization**: MixpanelMessageCodec for complex types
1616
- **Testing**: Flutter unit tests with mocked platform channels
1717

CLAUDE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ Future<void> methodName(parameters) async {
4848

4949
### Platform Dependencies
5050
- Android: Mixpanel Android SDK v8.0.3
51-
- iOS: Mixpanel-swift v5.0.0
51+
- iOS: Mixpanel-swift 6.1.0
52+
- macOS: Mixpanel-swift 6.1.0
5253
- Web: Mixpanel JavaScript library (loaded from CDN)
5354

5455
## Development Commands

example/.metadata

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,27 @@
44
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: 78910062997c3a836feee883712c241a5fd22983
8-
channel: stable
7+
revision: "90673a4eef275d1a6692c26ac80d6d746d41a73a"
8+
channel: "stable"
99

1010
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: 90673a4eef275d1a6692c26ac80d6d746d41a73a
17+
base_revision: 90673a4eef275d1a6692c26ac80d6d746d41a73a
18+
- platform: macos
19+
create_revision: 90673a4eef275d1a6692c26ac80d6d746d41a73a
20+
base_revision: 90673a4eef275d1a6692c26ac80d6d746d41a73a
21+
22+
# User provided section
23+
24+
# List of Local paths (relative to this file) that should be
25+
# ignored by the migrate tool.
26+
#
27+
# Files that are not part of the templates will be ignored by default.
28+
unmanaged_files:
29+
- 'lib/main.dart'
30+
- 'ios/Runner.xcodeproj/project.pbxproj'

example/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,5 @@
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
23-
<key>MinimumOSVersion</key>
24-
<string>13.0</string>
2523
</dict>
2624
</plist>

0 commit comments

Comments
 (0)