Skip to content

Commit

Permalink
Add mac sample and fix purchasing
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmontemagno committed Feb 8, 2021
1 parent e08ac95 commit 1d53809
Show file tree
Hide file tree
Showing 23 changed files with 1,083 additions and 17 deletions.
53 changes: 52 additions & 1 deletion src/InAppBilling.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
..\nuget\readme.txt = ..\nuget\readme.txt
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Plugin.InAppBilling", "Plugin.InAppBilling\Plugin.InAppBilling.csproj", "{C570E25E-259F-4D4C-88F0-B2982815192D}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin.InAppBilling", "Plugin.InAppBilling\Plugin.InAppBilling.csproj", "{C570E25E-259F-4D4C-88F0-B2982815192D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docs", "Docs", "{6A41C44D-4B82-4039-B2AC-07D668168569}"
ProjectSection(SolutionItems) = preProject
Expand All @@ -38,6 +38,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InAppBillingTests.UWP", "In
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InAppBillingTests", "InAppBillingTests\InAppBillingTests\InAppBillingTests.csproj", "{6D4D9135-F225-4626-A9CE-32BDF97AEA89}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InAppBillingTests.Mac", "InAppBillingTests\InAppBillingTests.Mac\InAppBillingTests.Mac.csproj", "{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Ad-Hoc|Any CPU = Ad-Hoc|Any CPU
Expand Down Expand Up @@ -328,6 +330,54 @@ Global
{6D4D9135-F225-4626-A9CE-32BDF97AEA89}.Release|x64.Build.0 = Release|Any CPU
{6D4D9135-F225-4626-A9CE-32BDF97AEA89}.Release|x86.ActiveCfg = Release|Any CPU
{6D4D9135-F225-4626-A9CE-32BDF97AEA89}.Release|x86.Build.0 = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Ad-Hoc|ARM.ActiveCfg = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Ad-Hoc|ARM.Build.0 = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Ad-Hoc|x64.ActiveCfg = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Ad-Hoc|x64.Build.0 = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Ad-Hoc|x86.ActiveCfg = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Ad-Hoc|x86.Build.0 = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.AppStore|Any CPU.Build.0 = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.AppStore|ARM.ActiveCfg = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.AppStore|ARM.Build.0 = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.AppStore|iPhone.ActiveCfg = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.AppStore|iPhone.Build.0 = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.AppStore|x64.ActiveCfg = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.AppStore|x64.Build.0 = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.AppStore|x86.ActiveCfg = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.AppStore|x86.Build.0 = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Debug|ARM.ActiveCfg = Debug|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Debug|ARM.Build.0 = Debug|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Debug|iPhone.Build.0 = Debug|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Debug|x64.ActiveCfg = Debug|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Debug|x64.Build.0 = Debug|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Debug|x86.ActiveCfg = Debug|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Debug|x86.Build.0 = Debug|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Release|Any CPU.Build.0 = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Release|ARM.ActiveCfg = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Release|ARM.Build.0 = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Release|iPhone.ActiveCfg = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Release|iPhone.Build.0 = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Release|x64.ActiveCfg = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Release|x64.Build.0 = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Release|x86.ActiveCfg = Release|Any CPU
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -337,6 +387,7 @@ Global
{096CE273-B696-42E5-8770-E06FBE982235} = {5124C265-C6EF-4415-9497-0EF227E43095}
{EBD6A824-A56E-4F33-B352-B4E72D711B00} = {5124C265-C6EF-4415-9497-0EF227E43095}
{6D4D9135-F225-4626-A9CE-32BDF97AEA89} = {5124C265-C6EF-4415-9497-0EF227E43095}
{04BF1C8C-EACA-466D-80D8-C2B9012A37F1} = {5124C265-C6EF-4415-9497-0EF227E43095}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {42D18242-8BA9-4238-9D59-10850E1C2C24}
Expand Down
34 changes: 34 additions & 0 deletions src/InAppBillingTests/InAppBillingTests.Mac/AppDelegate.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using AppKit;
using Foundation;
using Xamarin.Forms;
using Xamarin.Forms.Platform.MacOS;

namespace InAppBillingTests.Mac
{
[Register("AppDelegate")]
public class AppDelegate : FormsApplicationDelegate
{
NSWindow window;
public AppDelegate()
{
var style = NSWindowStyle.Closable | NSWindowStyle.Resizable | NSWindowStyle.Titled;

var rect = new CoreGraphics.CGRect(200, 1000, 1024, 768);
window = new NSWindow(rect, style, NSBackingStore.Buffered, false);
window.Title = "Xamarin.Forms on Mac!"; // choose your own Title here
window.TitleVisibility = NSWindowTitleVisibility.Hidden;
}

public override NSWindow MainWindow
{
get { return window; }
}

public override void DidFinishLaunching(NSNotification notification)
{
Forms.Init();
LoadApplication(new App());
base.DidFinishLaunching(notification);
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"images": [
{
"filename": "AppIcon-16.png",
"size": "16x16",
"scale": "1x",
"idiom": "mac"
},
{
"filename": "AppIcon-16@2x.png",
"size": "16x16",
"scale": "2x",
"idiom": "mac"
},
{
"filename": "AppIcon-32.png",
"size": "32x32",
"scale": "1x",
"idiom": "mac"
},
{
"filename": "AppIcon-32@2x.png",
"size": "32x32",
"scale": "2x",
"idiom": "mac"
},
{
"filename": "AppIcon-128.png",
"size": "128x128",
"scale": "1x",
"idiom": "mac"
},
{
"filename": "AppIcon-128@2x.png",
"size": "128x128",
"scale": "2x",
"idiom": "mac"
},
{
"filename": "AppIcon-256.png",
"size": "256x256",
"scale": "1x",
"idiom": "mac"
},
{
"filename": "AppIcon-256@2x.png",
"size": "256x256",
"scale": "2x",
"idiom": "mac"
},
{
"filename": "AppIcon-512.png",
"size": "512x512",
"scale": "1x",
"idiom": "mac"
},
{
"filename": "AppIcon-512@2x.png",
"size": "512x512",
"scale": "2x",
"idiom": "mac"
}
],
"info": {
"version": 1,
"author": "xcode"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{04BF1C8C-EACA-466D-80D8-C2B9012A37F1}</ProjectGuid>
<ProjectTypeGuids>{A3F8F2AB-B479-4A4A-A458-A89E7DC349F1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Exe</OutputType>
<RootNamespace>InAppBillingTests.Mac</RootNamespace>
<AssemblyName>iaptestmac</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<TargetFrameworkIdentifier>Xamarin.Mac</TargetFrameworkIdentifier>
<MonoMacResourcePrefix>Resources</MonoMacResourcePrefix>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<EnableCodeSigning>false</EnableCodeSigning>
<CodeSigningKey>Mac Developer</CodeSigningKey>
<CreatePackage>false</CreatePackage>
<EnablePackageSigning>false</EnablePackageSigning>
<IncludeMonoRuntime>false</IncludeMonoRuntime>
<UseSGen>true</UseSGen>
<UseRefCounting>true</UseRefCounting>
<Profiling>true</Profiling>
<HttpClientHandler></HttpClientHandler>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<DefineConstants></DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<EnableCodeSigning>false</EnableCodeSigning>
<CreatePackage>true</CreatePackage>
<EnablePackageSigning>false</EnablePackageSigning>
<IncludeMonoRuntime>true</IncludeMonoRuntime>
<UseSGen>true</UseSGen>
<UseRefCounting>true</UseRefCounting>
<CodeSignEntitlements>Entitlements.plist</CodeSignEntitlements>
<LinkMode>SdkOnly</LinkMode>
<HttpClientHandler></HttpClientHandler>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="Xamarin.Mac" />
</ItemGroup>
<ItemGroup>
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\Contents.json" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\AppIcon-128.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\AppIcon-128%402x.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\AppIcon-16.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\AppIcon-16%402x.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\AppIcon-256.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\AppIcon-256%402x.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\AppIcon-32.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\AppIcon-32%402x.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\AppIcon-512.png" />
<ImageAsset Include="Assets.xcassets\AppIcon.appiconset\AppIcon-512%402x.png" />
<ImageAsset Include="Assets.xcassets\Contents.json" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\" />
</ItemGroup>
<ItemGroup>
<None Include="Info.plist" />
<None Include="Entitlements.plist" />
</ItemGroup>
<ItemGroup>
<Compile Include="Main.cs" />
<Compile Include="AppDelegate.cs" />
<Compile Include="ViewController.cs" />
<Compile Include="ViewController.designer.cs">
<DependentUpon>ViewController.cs</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="4.7.0.1179" />
</ItemGroup>
<ItemGroup>
<InterfaceDefinition Include="Main.storyboard" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\InAppBillingTests\InAppBillingTests.csproj">
<Project>{6D4D9135-F225-4626-A9CE-32BDF97AEA89}</Project>
<Name>InAppBillingTests</Name>
</ProjectReference>
<ProjectReference Include="..\..\Plugin.InAppBilling\Plugin.InAppBilling.csproj">
<Project>{C570E25E-259F-4D4C-88F0-B2982815192D}</Project>
<Name>Plugin.InAppBilling</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Mac\Xamarin.Mac.CSharp.targets" />
</Project>
32 changes: 32 additions & 0 deletions src/InAppBillingTests/InAppBillingTests.Mac/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleName</key>
<string>iaptestmac</string>
<key>CFBundleIdentifier</key>
<string>com.refractored.iaptest</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>10.14</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>NSHumanReadableCopyright</key>
<string></string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>NSMainStoryboardFile</key>
<string>Main</string>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/AppIcon.appiconset</string>
</dict>
</plist>
14 changes: 14 additions & 0 deletions src/InAppBillingTests/InAppBillingTests.Mac/Main.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using AppKit;

namespace InAppBillingTests.Mac
{
static class MainClass
{
static void Main(string[] args)
{
NSApplication.Init();
NSApplication.SharedApplication.Delegate = new AppDelegate();
NSApplication.Main(args);
}
}
}
Loading

0 comments on commit 1d53809

Please sign in to comment.