Updating sample
|
@ -1,63 +0,0 @@
|
|||
using Foundation;
|
||||
using UIKit;
|
||||
|
||||
namespace Notifications
|
||||
{
|
||||
|
||||
|
||||
[Register("AppDelegate")]
|
||||
public class AppDelegate : UIApplicationDelegate
|
||||
{
|
||||
private MyViewController viewController;
|
||||
private UIWindow window;
|
||||
|
||||
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
|
||||
{
|
||||
window = new UIWindow(UIScreen.MainScreen.Bounds);
|
||||
|
||||
viewController = new MyViewController();
|
||||
window.RootViewController = viewController;
|
||||
|
||||
window.MakeKeyAndVisible();
|
||||
|
||||
// check for a notification
|
||||
if (options != null)
|
||||
{
|
||||
// check for a local notification
|
||||
if (options.ContainsKey(UIApplication.LaunchOptionsLocalNotificationKey))
|
||||
{
|
||||
var localNotification = options[UIApplication.LaunchOptionsLocalNotificationKey] as UILocalNotification;
|
||||
if (localNotification != null)
|
||||
{
|
||||
UIAlertController okayAlertController = UIAlertController.Create (localNotification.AlertAction, localNotification.AlertBody, UIAlertControllerStyle.Alert);
|
||||
okayAlertController.AddAction (UIAlertAction.Create ("OK", UIAlertActionStyle.Default, null));
|
||||
viewController.PresentViewController (okayAlertController, true, null);
|
||||
// reset our badge
|
||||
UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (UIDevice.CurrentDevice.CheckSystemVersion (8, 0)) {
|
||||
var notificationSettings = UIUserNotificationSettings.GetSettingsForTypes (
|
||||
UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound, null
|
||||
);
|
||||
|
||||
app.RegisterUserNotificationSettings (notificationSettings);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void ReceivedLocalNotification(UIApplication application, UILocalNotification notification)
|
||||
{
|
||||
// show an alert
|
||||
UIAlertController okayAlertController = UIAlertController.Create (notification.AlertAction, notification.AlertBody, UIAlertControllerStyle.Alert);
|
||||
okayAlertController.AddAction (UIAlertAction.Create ("OK", UIAlertActionStyle.Default, null));
|
||||
viewController.PresentViewController (okayAlertController, true, null);
|
||||
|
||||
// reset our badge
|
||||
UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
<?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>UIDeviceFamily</key>
|
||||
<array>
|
||||
<integer>1</integer>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>6.0</string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -1,65 +0,0 @@
|
|||
using System;
|
||||
using CoreGraphics;
|
||||
|
||||
using UIKit;
|
||||
using Foundation;
|
||||
|
||||
namespace Notifications
|
||||
{
|
||||
|
||||
public class MyViewController : UIViewController
|
||||
{
|
||||
private readonly nfloat buttonHeight = 50;
|
||||
private readonly nfloat buttonWidth = 300;
|
||||
private UIButton button;
|
||||
|
||||
public override void ViewDidLoad()
|
||||
{
|
||||
base.ViewDidLoad();
|
||||
|
||||
View.Frame = UIScreen.MainScreen.Bounds;
|
||||
View.BackgroundColor = UIColor.White;
|
||||
View.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
|
||||
AddButtonToView();
|
||||
|
||||
button.TouchUpInside += (sender, e) =>
|
||||
{
|
||||
//---- create the notification
|
||||
var notification = new UILocalNotification();
|
||||
|
||||
//---- set the fire date (the date time in which it will fire)
|
||||
notification.FireDate = NSDate.FromTimeIntervalSinceNow(15);
|
||||
|
||||
//---- configure the alert stuff
|
||||
notification.AlertAction = "View Alert";
|
||||
notification.AlertBody = "Your 15 second alert has fired!";
|
||||
|
||||
//---- modify the badge
|
||||
notification.ApplicationIconBadgeNumber = 1;
|
||||
|
||||
//---- set the sound to be the default sound
|
||||
notification.SoundName = UILocalNotification.DefaultSoundName;
|
||||
|
||||
//---- schedule it
|
||||
UIApplication.SharedApplication.ScheduleLocalNotification(notification);
|
||||
};
|
||||
}
|
||||
|
||||
private void AddButtonToView()
|
||||
{
|
||||
button = UIButton.FromType(UIButtonType.RoundedRect);
|
||||
|
||||
button.Frame = new CGRect(
|
||||
View.Frame.Width / 2 - buttonWidth / 2,
|
||||
View.Frame.Height / 2 - buttonHeight / 2,
|
||||
buttonWidth,
|
||||
buttonHeight);
|
||||
button.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleTopMargin |
|
||||
UIViewAutoresizing.FlexibleBottomMargin;
|
||||
button.SetTitle("Add notification", UIControlState.Normal);
|
||||
button.ContentMode = UIViewContentMode.ScaleToFill;
|
||||
|
||||
View.AddSubview(button);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,117 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
|
||||
<ProjectGuid>{20FF9B2C-D1F6-445A-8C9D-5419858EEBEC}</ProjectGuid>
|
||||
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>Notifications</RootNamespace>
|
||||
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
|
||||
<AssemblyName>Notifications</AssemblyName>
|
||||
<TargetFrameworkIdentifier>Xamarin.iOS</TargetFrameworkIdentifier>
|
||||
<TargetFrameworkVersion>v1.0</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>False</Optimize>
|
||||
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>False</ConsolePause>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
<MtouchDebug>True</MtouchDebug>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>True</Optimize>
|
||||
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>False</ConsolePause>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>False</Optimize>
|
||||
<OutputPath>bin\iPhone\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>False</ConsolePause>
|
||||
<MtouchDebug>True</MtouchDebug>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<MtouchArch>ARMv7</MtouchArch>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>True</Optimize>
|
||||
<OutputPath>bin\iPhone\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>False</ConsolePause>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<MtouchArch>ARMv7, ARM64</MtouchArch>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Ad-Hoc|iPhone' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>True</Optimize>
|
||||
<OutputPath>bin\iPhone\Ad-Hoc</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>False</ConsolePause>
|
||||
<CodesignKey>iPhone Distribution</CodesignKey>
|
||||
<BuildIpa>True</BuildIpa>
|
||||
<MtouchArch>ARMv7, ARM64</MtouchArch>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AppStore|iPhone' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>True</Optimize>
|
||||
<OutputPath>bin\iPhone\AppStore</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>False</ConsolePause>
|
||||
<CodesignKey>iPhone Distribution</CodesignKey>
|
||||
<MtouchArch>ARMv7, ARM64</MtouchArch>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Main.cs" />
|
||||
<Compile Include="AppDelegate.cs" />
|
||||
<None Include="Info.plist" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MyViewController.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="Xamarin.iOS" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BundleResource Include="Resources\Default.png" />
|
||||
<BundleResource Include="Resources\Default%402x.png" />
|
||||
<BundleResource Include="Resources\Default-568h%402x.png" />
|
||||
<BundleResource Include="Resources\Default-Landscape%402x~ipad.png" />
|
||||
<BundleResource Include="Resources\Default-Landscape~ipad.png" />
|
||||
<BundleResource Include="Resources\Default-Portrait%402x~ipad.png" />
|
||||
<BundleResource Include="Resources\Default-Portrait~ipad.png" />
|
||||
<BundleResource Include="Resources\icon-100.png" />
|
||||
<BundleResource Include="Resources\icon-114.png" />
|
||||
<BundleResource Include="Resources\icon-144.png" />
|
||||
<BundleResource Include="Resources\icon-29.png">
|
||||
<DependentUpon>icon-50.png</DependentUpon>
|
||||
</BundleResource>
|
||||
<BundleResource Include="Resources\icon-50.png" />
|
||||
<BundleResource Include="Resources\icon-57.png" />
|
||||
<BundleResource Include="Resources\icon-58.png" />
|
||||
<BundleResource Include="Resources\icon-72.png" />
|
||||
<BundleResource Include="Resources\iTunesArtwork.png" />
|
||||
<BundleResource Include="Resources\iTunesArtwork%402x.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||
</Project>
|
|
@ -1,36 +0,0 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Notifications")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Notifications")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2013")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("15162510-d908-45d0-a5ec-0a726bac7e59")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
До Ширина: | Высота: | Размер: 12 KiB |
До Ширина: | Высота: | Размер: 24 KiB |
До Ширина: | Высота: | Размер: 9.4 KiB |
До Ширина: | Высота: | Размер: 25 KiB |
До Ширина: | Высота: | Размер: 9.8 KiB |
Двоичные данные
LocalNotifications/Notifications.iOS/Resources/Default.png
До Ширина: | Высота: | Размер: 5.2 KiB |
Двоичные данные
LocalNotifications/Notifications.iOS/Resources/Default@2x.png
До Ширина: | Высота: | Размер: 12 KiB |
Двоичные данные
LocalNotifications/Notifications.iOS/Resources/icon-58.png
До Ширина: | Высота: | Размер: 5.2 KiB |
Двоичные данные
LocalNotifications/Notifications.iOS/Resources/icon-72.png
До Ширина: | Высота: | Размер: 6.6 KiB |
|
@ -1,62 +1,23 @@
|
|||
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Notifications.iOS", "Notifications.iOS\Notifications.iOS.csproj", "{20FF9B2C-D1F6-445A-8C9D-5419858EEBEC}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Notifications", "Notifications\Notifications.csproj", "{C838053B-4D84-4E33-9521-EF2E64B4DE54}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Ad-Hoc|Any CPU = Ad-Hoc|Any CPU
|
||||
Ad-Hoc|iPhone = Ad-Hoc|iPhone
|
||||
Ad-Hoc|iPhoneSimulator = Ad-Hoc|iPhoneSimulator
|
||||
Ad-Hoc|Mixed Platforms = Ad-Hoc|Mixed Platforms
|
||||
AppStore|Any CPU = AppStore|Any CPU
|
||||
AppStore|iPhone = AppStore|iPhone
|
||||
AppStore|iPhoneSimulator = AppStore|iPhoneSimulator
|
||||
AppStore|Mixed Platforms = AppStore|Mixed Platforms
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|iPhone = Debug|iPhone
|
||||
Debug|iPhoneSimulator = Debug|iPhoneSimulator
|
||||
Debug|Mixed Platforms = Debug|Mixed Platforms
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|iPhone = Release|iPhone
|
||||
Release|iPhoneSimulator = Release|iPhoneSimulator
|
||||
Release|Mixed Platforms = Release|Mixed Platforms
|
||||
Debug|iPhone = Debug|iPhone
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{20FF9B2C-D1F6-445A-8C9D-5419858EEBEC}.Ad-Hoc|Any CPU.ActiveCfg = Ad-Hoc|iPhone
|
||||
{20FF9B2C-D1F6-445A-8C9D-5419858EEBEC}.Ad-Hoc|Any CPU.Build.0 = Ad-Hoc|iPhone
|
||||
{20FF9B2C-D1F6-445A-8C9D-5419858EEBEC}.Ad-Hoc|iPhone.ActiveCfg = Ad-Hoc|iPhone
|
||||
{20FF9B2C-D1F6-445A-8C9D-5419858EEBEC}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone
|
||||
{20FF9B2C-D1F6-445A-8C9D-5419858EEBEC}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
|
||||
{20FF9B2C-D1F6-445A-8C9D-5419858EEBEC}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
|
||||
{20FF9B2C-D1F6-445A-8C9D-5419858EEBEC}.Ad-Hoc|Mixed Platforms.ActiveCfg = Ad-Hoc|iPhone
|
||||
{20FF9B2C-D1F6-445A-8C9D-5419858EEBEC}.Ad-Hoc|Mixed Platforms.Build.0 = Ad-Hoc|iPhone
|
||||
{20FF9B2C-D1F6-445A-8C9D-5419858EEBEC}.AppStore|Any CPU.ActiveCfg = AppStore|iPhone
|
||||
{20FF9B2C-D1F6-445A-8C9D-5419858EEBEC}.AppStore|Any CPU.Build.0 = AppStore|iPhone
|
||||
{20FF9B2C-D1F6-445A-8C9D-5419858EEBEC}.AppStore|iPhone.ActiveCfg = AppStore|iPhone
|
||||
{20FF9B2C-D1F6-445A-8C9D-5419858EEBEC}.AppStore|iPhone.Build.0 = AppStore|iPhone
|
||||
{20FF9B2C-D1F6-445A-8C9D-5419858EEBEC}.AppStore|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
|
||||
{20FF9B2C-D1F6-445A-8C9D-5419858EEBEC}.AppStore|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
|
||||
{20FF9B2C-D1F6-445A-8C9D-5419858EEBEC}.AppStore|Mixed Platforms.ActiveCfg = AppStore|iPhone
|
||||
{20FF9B2C-D1F6-445A-8C9D-5419858EEBEC}.AppStore|Mixed Platforms.Build.0 = AppStore|iPhone
|
||||
{20FF9B2C-D1F6-445A-8C9D-5419858EEBEC}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator
|
||||
{20FF9B2C-D1F6-445A-8C9D-5419858EEBEC}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator
|
||||
{20FF9B2C-D1F6-445A-8C9D-5419858EEBEC}.Debug|iPhone.ActiveCfg = Debug|iPhone
|
||||
{20FF9B2C-D1F6-445A-8C9D-5419858EEBEC}.Debug|iPhone.Build.0 = Debug|iPhone
|
||||
{20FF9B2C-D1F6-445A-8C9D-5419858EEBEC}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
|
||||
{20FF9B2C-D1F6-445A-8C9D-5419858EEBEC}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
|
||||
{20FF9B2C-D1F6-445A-8C9D-5419858EEBEC}.Debug|Mixed Platforms.ActiveCfg = Debug|iPhoneSimulator
|
||||
{20FF9B2C-D1F6-445A-8C9D-5419858EEBEC}.Debug|Mixed Platforms.Build.0 = Debug|iPhoneSimulator
|
||||
{20FF9B2C-D1F6-445A-8C9D-5419858EEBEC}.Release|Any CPU.ActiveCfg = Release|iPhoneSimulator
|
||||
{20FF9B2C-D1F6-445A-8C9D-5419858EEBEC}.Release|Any CPU.Build.0 = Release|iPhoneSimulator
|
||||
{20FF9B2C-D1F6-445A-8C9D-5419858EEBEC}.Release|iPhone.ActiveCfg = Release|iPhone
|
||||
{20FF9B2C-D1F6-445A-8C9D-5419858EEBEC}.Release|iPhone.Build.0 = Release|iPhone
|
||||
{20FF9B2C-D1F6-445A-8C9D-5419858EEBEC}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
|
||||
{20FF9B2C-D1F6-445A-8C9D-5419858EEBEC}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
|
||||
{20FF9B2C-D1F6-445A-8C9D-5419858EEBEC}.Release|Mixed Platforms.ActiveCfg = Release|iPhoneSimulator
|
||||
{20FF9B2C-D1F6-445A-8C9D-5419858EEBEC}.Release|Mixed Platforms.Build.0 = Release|iPhoneSimulator
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
{C838053B-4D84-4E33-9521-EF2E64B4DE54}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
|
||||
{C838053B-4D84-4E33-9521-EF2E64B4DE54}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
|
||||
{C838053B-4D84-4E33-9521-EF2E64B4DE54}.Release|iPhone.ActiveCfg = Release|iPhone
|
||||
{C838053B-4D84-4E33-9521-EF2E64B4DE54}.Release|iPhone.Build.0 = Release|iPhone
|
||||
{C838053B-4D84-4E33-9521-EF2E64B4DE54}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
|
||||
{C838053B-4D84-4E33-9521-EF2E64B4DE54}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
|
||||
{C838053B-4D84-4E33-9521-EF2E64B4DE54}.Debug|iPhone.ActiveCfg = Debug|iPhone
|
||||
{C838053B-4D84-4E33-9521-EF2E64B4DE54}.Debug|iPhone.Build.0 = Debug|iPhone
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -0,0 +1,99 @@
|
|||
using Foundation;
|
||||
using UIKit;
|
||||
|
||||
namespace Notifications
|
||||
{
|
||||
// The UIApplicationDelegate for the application. This class is responsible for launching the
|
||||
// User Interface of the application, as well as listening (and optionally responding) to application events from iOS.
|
||||
[Register("AppDelegate")]
|
||||
public class AppDelegate : UIApplicationDelegate
|
||||
{
|
||||
// class-level declarations
|
||||
|
||||
public override UIWindow Window
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
|
||||
public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
|
||||
{
|
||||
if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0))
|
||||
{
|
||||
var notificationSettings = UIUserNotificationSettings.GetSettingsForTypes(
|
||||
UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound, null
|
||||
);
|
||||
|
||||
|
||||
application.RegisterUserNotificationSettings(notificationSettings);
|
||||
}
|
||||
|
||||
// check for a notification
|
||||
if (launchOptions != null)
|
||||
{
|
||||
// check for a local notification
|
||||
if (launchOptions.ContainsKey(UIApplication.LaunchOptionsLocalNotificationKey))
|
||||
{
|
||||
var localNotification = launchOptions[UIApplication.LaunchOptionsLocalNotificationKey] as UILocalNotification;
|
||||
if (localNotification != null)
|
||||
{
|
||||
UIAlertController okayAlertController = UIAlertController.Create(localNotification.AlertAction, localNotification.AlertBody, UIAlertControllerStyle.Alert);
|
||||
okayAlertController.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null));
|
||||
|
||||
Window.RootViewController.PresentViewController(okayAlertController, true, null);
|
||||
|
||||
// reset our badge
|
||||
UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void ReceivedLocalNotification(UIApplication application, UILocalNotification notification)
|
||||
{
|
||||
// show an alert
|
||||
UIAlertController okayAlertController = UIAlertController.Create(notification.AlertAction, notification.AlertBody, UIAlertControllerStyle.Alert);
|
||||
okayAlertController.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null));
|
||||
|
||||
Window.RootViewController.PresentViewController(okayAlertController, true, null);
|
||||
|
||||
// reset our badge
|
||||
UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0;
|
||||
}
|
||||
|
||||
public override void OnResignActivation(UIApplication application)
|
||||
{
|
||||
// Invoked when the application is about to move from active to inactive state.
|
||||
// This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message)
|
||||
// or when the user quits the application and it begins the transition to the background state.
|
||||
// Games should use this method to pause the game.
|
||||
}
|
||||
|
||||
public override void DidEnterBackground(UIApplication application)
|
||||
{
|
||||
// Use this method to release shared resources, save user data, invalidate timers and store the application state.
|
||||
// If your application supports background exection this method is called instead of WillTerminate when the user quits.
|
||||
}
|
||||
|
||||
public override void WillEnterForeground(UIApplication application)
|
||||
{
|
||||
// Called as part of the transiton from background to active state.
|
||||
// Here you can undo many of the changes made on entering the background.
|
||||
}
|
||||
|
||||
public override void OnActivated(UIApplication application)
|
||||
{
|
||||
// Restart any tasks that were paused (or not yet started) while the application was inactive.
|
||||
// If the application was previously in the background, optionally refresh the user interface.
|
||||
}
|
||||
|
||||
public override void WillTerminate(UIApplication application)
|
||||
{
|
||||
// Called when the application is about to terminate. Save data, if needed. See also DidEnterBackground.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,225 @@
|
|||
{
|
||||
"images": [
|
||||
{
|
||||
"filename": "Icon-Small.png",
|
||||
"size": "29x29",
|
||||
"scale": "1x",
|
||||
"idiom": "iphone"
|
||||
},
|
||||
{
|
||||
"filename": "Icon-Small@2x.png",
|
||||
"size": "29x29",
|
||||
"scale": "2x",
|
||||
"idiom": "iphone"
|
||||
},
|
||||
{
|
||||
"filename": "Icon-Small@3x.png",
|
||||
"size": "29x29",
|
||||
"scale": "3x",
|
||||
"idiom": "iphone"
|
||||
},
|
||||
{
|
||||
"filename": "Icon-Spotlight-40@2x.png",
|
||||
"size": "40x40",
|
||||
"scale": "2x",
|
||||
"idiom": "iphone"
|
||||
},
|
||||
{
|
||||
"filename": "Icon-Spotlight-40@3x.png",
|
||||
"size": "40x40",
|
||||
"scale": "3x",
|
||||
"idiom": "iphone"
|
||||
},
|
||||
{
|
||||
"filename": "Icon.png",
|
||||
"size": "57x57",
|
||||
"scale": "1x",
|
||||
"idiom": "iphone"
|
||||
},
|
||||
{
|
||||
"filename": "Icon@2x.png",
|
||||
"size": "57x57",
|
||||
"scale": "2x",
|
||||
"idiom": "iphone"
|
||||
},
|
||||
{
|
||||
"filename": "Icon-60@2x.png",
|
||||
"size": "60x60",
|
||||
"scale": "2x",
|
||||
"idiom": "iphone"
|
||||
},
|
||||
{
|
||||
"filename": "Icon-60@3x.png",
|
||||
"size": "60x60",
|
||||
"scale": "3x",
|
||||
"idiom": "iphone"
|
||||
},
|
||||
{
|
||||
"filename": "icon-29.png",
|
||||
"size": "29x29",
|
||||
"scale": "1x",
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"size": "29x29",
|
||||
"scale": "2x",
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"size": "40x40",
|
||||
"scale": "1x",
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"size": "40x40",
|
||||
"scale": "2x",
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"filename": "icon-50.png",
|
||||
"size": "50x50",
|
||||
"scale": "1x",
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"filename": "icon-100.png",
|
||||
"size": "50x50",
|
||||
"scale": "2x",
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"size": "83.5x83.5",
|
||||
"scale": "2x",
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"size": "72x72",
|
||||
"scale": "1x",
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"filename": "icon-144.png",
|
||||
"size": "72x72",
|
||||
"scale": "2x",
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"size": "76x76",
|
||||
"scale": "1x",
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"size": "76x76",
|
||||
"scale": "2x",
|
||||
"idiom": "ipad"
|
||||
},
|
||||
{
|
||||
"role": "notificationCenter",
|
||||
"size": "24x24",
|
||||
"subtype": "38mm",
|
||||
"scale": "2x",
|
||||
"idiom": "watch"
|
||||
},
|
||||
{
|
||||
"role": "notificationCenter",
|
||||
"size": "27.5x27.5",
|
||||
"subtype": "42mm",
|
||||
"scale": "2x",
|
||||
"idiom": "watch"
|
||||
},
|
||||
{
|
||||
"role": "companionSettings",
|
||||
"size": "29x29",
|
||||
"scale": "2x",
|
||||
"idiom": "watch"
|
||||
},
|
||||
{
|
||||
"role": "companionSettings",
|
||||
"size": "29x29",
|
||||
"scale": "3x",
|
||||
"idiom": "watch"
|
||||
},
|
||||
{
|
||||
"role": "appLauncher",
|
||||
"size": "40x40",
|
||||
"subtype": "38mm",
|
||||
"scale": "2x",
|
||||
"idiom": "watch"
|
||||
},
|
||||
{
|
||||
"role": "longLook",
|
||||
"size": "44x44",
|
||||
"subtype": "42mm",
|
||||
"scale": "2x",
|
||||
"idiom": "watch"
|
||||
},
|
||||
{
|
||||
"role": "quickLook",
|
||||
"size": "86x86",
|
||||
"subtype": "38mm",
|
||||
"scale": "2x",
|
||||
"idiom": "watch"
|
||||
},
|
||||
{
|
||||
"role": "quickLook",
|
||||
"size": "98x98",
|
||||
"subtype": "42mm",
|
||||
"scale": "2x",
|
||||
"idiom": "watch"
|
||||
},
|
||||
{
|
||||
"size": "16x16",
|
||||
"scale": "1x",
|
||||
"idiom": "mac"
|
||||
},
|
||||
{
|
||||
"size": "16x16",
|
||||
"scale": "2x",
|
||||
"idiom": "mac"
|
||||
},
|
||||
{
|
||||
"size": "32x32",
|
||||
"scale": "1x",
|
||||
"idiom": "mac"
|
||||
},
|
||||
{
|
||||
"size": "32x32",
|
||||
"scale": "2x",
|
||||
"idiom": "mac"
|
||||
},
|
||||
{
|
||||
"size": "128x128",
|
||||
"scale": "1x",
|
||||
"idiom": "mac"
|
||||
},
|
||||
{
|
||||
"size": "128x128",
|
||||
"scale": "2x",
|
||||
"idiom": "mac"
|
||||
},
|
||||
{
|
||||
"size": "256x256",
|
||||
"scale": "1x",
|
||||
"idiom": "mac"
|
||||
},
|
||||
{
|
||||
"size": "256x256",
|
||||
"scale": "2x",
|
||||
"idiom": "mac"
|
||||
},
|
||||
{
|
||||
"size": "512x512",
|
||||
"scale": "1x",
|
||||
"idiom": "mac"
|
||||
},
|
||||
{
|
||||
"size": "512x512",
|
||||
"scale": "2x",
|
||||
"idiom": "mac"
|
||||
}
|
||||
],
|
||||
"info": {
|
||||
"version": 1,
|
||||
"author": "xcode"
|
||||
}
|
||||
}
|
Двоичные данные
LocalNotifications/Notifications/Assets.xcassets/AppIcons.appiconset/Icon-60@2x.png
Normal file
После Ширина: | Высота: | Размер: 7.0 KiB |
Двоичные данные
LocalNotifications/Notifications/Assets.xcassets/AppIcons.appiconset/Icon-60@3x.png
Normal file
После Ширина: | Высота: | Размер: 4.5 KiB |
Двоичные данные
LocalNotifications/Notifications/Assets.xcassets/AppIcons.appiconset/Icon-Small.png
Normal file
После Ширина: | Высота: | Размер: 3.6 KiB |
Двоичные данные
LocalNotifications/Notifications/Assets.xcassets/AppIcons.appiconset/Icon-Small@2x.png
Normal file
После Ширина: | Высота: | Размер: 4.7 KiB |
Двоичные данные
LocalNotifications/Notifications/Assets.xcassets/AppIcons.appiconset/Icon-Small@3x.png
Normal file
После Ширина: | Высота: | Размер: 1.9 KiB |
Двоичные данные
LocalNotifications/Notifications/Assets.xcassets/AppIcons.appiconset/Icon-Spotlight-40@2x.png
Normal file
После Ширина: | Высота: | Размер: 5.5 KiB |
Двоичные данные
LocalNotifications/Notifications/Assets.xcassets/AppIcons.appiconset/Icon-Spotlight-40@3x.png
Normal file
После Ширина: | Высота: | Размер: 2.3 KiB |
Двоичные данные
LocalNotifications/Notifications/Assets.xcassets/AppIcons.appiconset/Icon.png
Normal file
После Ширина: | Высота: | Размер: 4.7 KiB |
Двоичные данные
LocalNotifications/Notifications/Assets.xcassets/AppIcons.appiconset/Icon@2x.png
Normal file
После Ширина: | Высота: | Размер: 6.8 KiB |
До Ширина: | Высота: | Размер: 11 KiB После Ширина: | Высота: | Размер: 11 KiB |
До Ширина: | Высота: | Размер: 14 KiB После Ширина: | Высота: | Размер: 14 KiB |
До Ширина: | Высота: | Размер: 18 KiB После Ширина: | Высота: | Размер: 18 KiB |
До Ширина: | Высота: | Размер: 2.0 KiB После Ширина: | Высота: | Размер: 2.0 KiB |
До Ширина: | Высота: | Размер: 4.2 KiB После Ширина: | Высота: | Размер: 4.2 KiB |
До Ширина: | Высота: | Размер: 5.1 KiB После Ширина: | Высота: | Размер: 5.1 KiB |
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"images": [],
|
||||
"info": {
|
||||
"version": 1,
|
||||
"author": "xcode"
|
||||
}
|
||||
}
|
|
@ -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>
|
|
@ -0,0 +1,41 @@
|
|||
<?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>Notifications</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.xamarin.notifications</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>9.3</string>
|
||||
<key>UIDeviceFamily</key>
|
||||
<array>
|
||||
<integer>1</integer>
|
||||
<integer>2</integer>
|
||||
</array>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>XSAppIconAssets</key>
|
||||
<string>Assets.xcassets/AppIcons.appiconset</string>
|
||||
<key>XSLaunchImageAssets</key>
|
||||
<string>Assets.xcassets/LaunchImage.launchimage</string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -0,0 +1,27 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS" />
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530" />
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="EHf-IW-A2E">
|
||||
<objects>
|
||||
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb" />
|
||||
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok" />
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600" />
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES" />
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite" />
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder" />
|
||||
</objects>
|
||||
<point key="canvasLocation" x="53" y="375" />
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
6
LocalNotifications/Notifications.iOS/Main.cs → LocalNotifications/Notifications/Main.cs
Executable file → Normal file
|
@ -1,11 +1,11 @@
|
|||
using UIKit;
|
||||
|
||||
namespace Notifications
|
||||
{
|
||||
using UIKit;
|
||||
|
||||
public class Application
|
||||
{
|
||||
// This is the main entry point of the application.
|
||||
private static void Main(string[] args)
|
||||
static void Main(string[] args)
|
||||
{
|
||||
// if you want to use a different Application Delegate class from "AppDelegate"
|
||||
// you can specify it here.
|
|
@ -0,0 +1,44 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="tne-QT-ifu">
|
||||
<objects>
|
||||
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="3" translatesAutoresizingMaskIntoConstraints="NO">
|
||||
<rect key="frame" x="180" y="285" width="253" height="30"/>
|
||||
<state key="normal" title="Add Notification">
|
||||
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<constraints>
|
||||
<constraint id="6" firstItem="3" firstAttribute="width" constant="253"/>
|
||||
</constraints>
|
||||
</button>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint id="4" firstItem="3" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" constant="6"/>
|
||||
<constraint id="5" firstItem="8bC-Xf-vdC" firstAttribute="bottom" secondItem="3" secondAttribute="bottom" constant="285"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="button" destination="3" id="name-outlet-3"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="0.0" y="0.0"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
|
@ -0,0 +1,140 @@
|
|||
<?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)' == '' ">iPhoneSimulator</Platform>
|
||||
<ProjectGuid>{C838053B-4D84-4E33-9521-EF2E64B4DE54}</ProjectGuid>
|
||||
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>Notifications</RootNamespace>
|
||||
<AssemblyName>Notifications</AssemblyName>
|
||||
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;ENABLE_TEST_CLOUD;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<MtouchDebug>true</MtouchDebug>
|
||||
<MtouchFastDev>true</MtouchFastDev>
|
||||
<MtouchProfiling>true</MtouchProfiling>
|
||||
<MtouchUseSGen>true</MtouchUseSGen>
|
||||
<MtouchUseRefCounting>true</MtouchUseRefCounting>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
<MtouchArch>i386</MtouchArch>
|
||||
<MtouchHttpClientHandler>HttpClientHandler</MtouchHttpClientHandler>
|
||||
<MtouchTlsProvider>Default</MtouchTlsProvider>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\iPhone\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<MtouchUseSGen>true</MtouchUseSGen>
|
||||
<MtouchUseRefCounting>true</MtouchUseRefCounting>
|
||||
<MtouchFloat32>true</MtouchFloat32>
|
||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||
<MtouchLink>SdkOnly</MtouchLink>
|
||||
<MtouchArch>ARMv7, ARM64</MtouchArch>
|
||||
<MtouchHttpClientHandler>HttpClientHandler</MtouchHttpClientHandler>
|
||||
<MtouchTlsProvider>Default</MtouchTlsProvider>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<MtouchUseSGen>true</MtouchUseSGen>
|
||||
<MtouchUseRefCounting>true</MtouchUseRefCounting>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
<MtouchArch>i386</MtouchArch>
|
||||
<MtouchHttpClientHandler>HttpClientHandler</MtouchHttpClientHandler>
|
||||
<MtouchTlsProvider>Default</MtouchTlsProvider>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhone\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;ENABLE_TEST_CLOUD;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<DeviceSpecificBuild>true</DeviceSpecificBuild>
|
||||
<MtouchDebug>true</MtouchDebug>
|
||||
<MtouchFastDev>true</MtouchFastDev>
|
||||
<MtouchProfiling>true</MtouchProfiling>
|
||||
<MtouchUseSGen>true</MtouchUseSGen>
|
||||
<MtouchUseRefCounting>true</MtouchUseRefCounting>
|
||||
<MtouchFloat32>true</MtouchFloat32>
|
||||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||
<MtouchLink>SdkOnly</MtouchLink>
|
||||
<MtouchArch>ARMv7, ARM64</MtouchArch>
|
||||
<MtouchHttpClientHandler>HttpClientHandler</MtouchHttpClientHandler>
|
||||
<MtouchTlsProvider>Default</MtouchTlsProvider>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="Xamarin.iOS" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ImageAsset Include="Assets.xcassets\AppIcons.appiconset\Contents.json" />
|
||||
<ImageAsset Include="Assets.xcassets\Contents.json" />
|
||||
<ImageAsset Include="Assets.xcassets\LaunchImage.launchimage\Contents.json" />
|
||||
<ImageAsset Include="Assets.xcassets\AppIcons.appiconset\icon-29.png" />
|
||||
<ImageAsset Include="Assets.xcassets\AppIcons.appiconset\icon-57.png" />
|
||||
<ImageAsset Include="Assets.xcassets\AppIcons.appiconset\icon-114.png" />
|
||||
<ImageAsset Include="Assets.xcassets\AppIcons.appiconset\icon-144.png" />
|
||||
<ImageAsset Include="Assets.xcassets\AppIcons.appiconset\icon-100.png" />
|
||||
<ImageAsset Include="Assets.xcassets\AppIcons.appiconset\icon-50.png" />
|
||||
<ImageAsset Include="Assets.xcassets\AppIcons.appiconset\Icon-Small%402x.png" />
|
||||
<ImageAsset Include="Assets.xcassets\AppIcons.appiconset\Icon-Small%403x.png" />
|
||||
<ImageAsset Include="Assets.xcassets\AppIcons.appiconset\Icon-Spotlight-40%402x.png" />
|
||||
<ImageAsset Include="Assets.xcassets\AppIcons.appiconset\Icon-Spotlight-40%403x.png" />
|
||||
<ImageAsset Include="Assets.xcassets\AppIcons.appiconset\Icon-60%402x.png" />
|
||||
<ImageAsset Include="Assets.xcassets\AppIcons.appiconset\Icon-60%403x.png" />
|
||||
<ImageAsset Include="Assets.xcassets\AppIcons.appiconset\Icon-Small.png" />
|
||||
<ImageAsset Include="Assets.xcassets\AppIcons.appiconset\Icon.png" />
|
||||
<ImageAsset Include="Assets.xcassets\AppIcons.appiconset\Icon%402x.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Resources\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<InterfaceDefinition Include="LaunchScreen.storyboard" />
|
||||
<InterfaceDefinition Include="Main.storyboard" />
|
||||
</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>
|
||||
<ITunesArtwork Include="iTunesArtwork" />
|
||||
<ITunesArtwork Include="iTunesArtwork%402x" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||
</Project>
|
|
@ -0,0 +1,50 @@
|
|||
using System;
|
||||
using Foundation;
|
||||
using UIKit;
|
||||
|
||||
namespace Notifications
|
||||
{
|
||||
public partial class ViewController : UIViewController
|
||||
{
|
||||
|
||||
protected ViewController(IntPtr handle) : base(handle)
|
||||
{
|
||||
// Note: this .ctor should not contain any initialization logic.
|
||||
}
|
||||
|
||||
public override void ViewDidLoad()
|
||||
{
|
||||
base.ViewDidLoad();
|
||||
|
||||
button.TouchUpInside += (sender, e) =>
|
||||
{
|
||||
// create the notification
|
||||
var notification = new UILocalNotification();
|
||||
|
||||
// set the fire date (the date time in which it will fire)
|
||||
notification.FireDate = NSDate.FromTimeIntervalSinceNow(10);
|
||||
|
||||
// configure the alert
|
||||
notification.AlertAction = "View Alert";
|
||||
notification.AlertBody = "Your 10 second alert has fired!";
|
||||
|
||||
// modify the badge
|
||||
notification.ApplicationIconBadgeNumber = 1;
|
||||
|
||||
// set the sound to be the default sound
|
||||
notification.SoundName = UILocalNotification.DefaultSoundName;
|
||||
|
||||
// schedule it
|
||||
UIApplication.SharedApplication.ScheduleLocalNotification(notification);
|
||||
Console.WriteLine("Scheduled...");
|
||||
};
|
||||
}
|
||||
|
||||
public override void DidReceiveMemoryWarning()
|
||||
{
|
||||
base.DidReceiveMemoryWarning();
|
||||
// Release any cached data, images, etc that aren't in use.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
// WARNING
|
||||
//
|
||||
// This file has been generated automatically by Xamarin Studio from the outlets and
|
||||
// actions declared in your storyboard file.
|
||||
// Manual changes to this file will not be maintained.
|
||||
//
|
||||
using Foundation;
|
||||
using System;
|
||||
using System.CodeDom.Compiler;
|
||||
using UIKit;
|
||||
|
||||
namespace Notifications
|
||||
{
|
||||
[Register ("ViewController")]
|
||||
partial class ViewController
|
||||
{
|
||||
[Outlet]
|
||||
[GeneratedCode ("iOS Designer", "1.0")]
|
||||
UIKit.UIButton button { get; set; }
|
||||
|
||||
void ReleaseDesignerOutlets ()
|
||||
{
|
||||
if (button != null) {
|
||||
button.Dispose ();
|
||||
button = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
До Ширина: | Высота: | Размер: 106 KiB После Ширина: | Высота: | Размер: 106 KiB |
До Ширина: | Высота: | Размер: 273 KiB После Ширина: | Высота: | Размер: 273 KiB |
Двоичные данные
LocalNotifications/Screenshots/01.png
До Ширина: | Высота: | Размер: 119 KiB |
Двоичные данные
LocalNotifications/Screenshots/02.png
До Ширина: | Высота: | Размер: 176 KiB |
Двоичные данные
LocalNotifications/Screenshots/03.png
До Ширина: | Высота: | Размер: 187 KiB |
После Ширина: | Высота: | Размер: 57 KiB |
После Ширина: | Высота: | Размер: 21 KiB |
После Ширина: | Высота: | Размер: 29 KiB |