Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit c5220ef

Browse files
authored
[in_app_purchase] Add support for macOS (#6519)
* Updated version and changelog. * Updated readme to mention MacOS as a supported platform. * Minor fixup. * Fixed capitalization in readme. * Added macos to example. * Updated MacOS example. * Unified macOS capitalization. * Removed generated app icons. * Updated version and deployment target. * Updated version to a minor version change. Was previously only a patch.
1 parent 3d8b73b commit c5220ef

23 files changed

+1261
-8
lines changed

packages/in_app_purchase/in_app_purchase/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 3.1.0
2+
3+
* Adds macOS as a supported platform.
4+
15
## 3.0.8
26

37
* Updates minimum Flutter version to 2.10.

packages/in_app_purchase/in_app_purchase/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ A storefront-independent API for purchases in Flutter apps.
33
<!-- If this package were in its own repo, we'd put badges here -->
44

55
This plugin supports in-app purchases (_IAP_) through an _underlying store_,
6-
which can be the App Store (on iOS) or Google Play (on Android).
6+
which can be the App Store (on iOS and macOS) or Google Play (on Android).
77

8-
| | Android | iOS |
9-
|-------------|---------|------|
10-
| **Support** | SDK 16+ | 9.0+ |
8+
| | Android | iOS | macOS |
9+
|-------------|---------|------|--------|
10+
| **Support** | SDK 16+ | 9.0+ | 10.15+ |
1111

1212
<p>
1313
<img src="https://github.com/flutter/plugins/blob/main/packages/in_app_purchase/in_app_purchase/doc/iap_ios.gif?raw=true"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2+
#include "ephemeral/Flutter-Generated.xcconfig"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2+
#include "ephemeral/Flutter-Generated.xcconfig"
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
platform :osx, '10.15'
2+
3+
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
4+
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
5+
6+
project 'Runner', {
7+
'Debug' => :debug,
8+
'Profile' => :release,
9+
'Release' => :release,
10+
}
11+
12+
def flutter_root
13+
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
14+
unless File.exist?(generated_xcode_build_settings_path)
15+
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
16+
end
17+
18+
File.foreach(generated_xcode_build_settings_path) do |line|
19+
matches = line.match(/FLUTTER_ROOT\=(.*)/)
20+
return matches[1].strip if matches
21+
end
22+
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
23+
end
24+
25+
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
26+
27+
flutter_macos_podfile_setup
28+
29+
target 'Runner' do
30+
use_frameworks!
31+
use_modular_headers!
32+
33+
flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
34+
end
35+
36+
post_install do |installer|
37+
installer.pods_project.targets.each do |target|
38+
flutter_additional_macos_build_settings(target)
39+
end
40+
end

0 commit comments

Comments
 (0)