This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using MonoTouch.Foundation; | |
using MonoTouch.UIKit; | |
using System.Threading.Tasks; | |
namespace BasicTable { | |
public class TableSource : UITableViewSource { | |
protected string[] tableItems; | |
protected string cellIdentifier = "TableCell"; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UIApplication.SharedApplication.OpenUrl(new NSUrl("itms-apps://itunes.apple.com/app/idAPP_ID")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int SystemVersion = Convert.ToInt16(UIDevice.CurrentDevice.SystemVersion.Split ('.') [0].ToString ()); | |
if (SystemVersion >= 7) { | |
this.EdgesForExtendedLayout = UIRectEdge.None; | |
this.AutomaticallyAdjustsScrollViewInsets = false; | |
this.ExtendedLayoutIncludesOpaqueBars = false; | |
} | |
or |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async void Demo () | |
{ | |
switch (await ShowAlert ("Title", "Message", "Ok", "Cancel")){ | |
case 0: // Ok | |
.... | |
case 1: // Cancel | |
.... | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string GetSSID(bool withMacAddress = true) | |
{ | |
try { | |
NSDictionary dict; | |
var status = CaptiveNetwork.TryCopyCurrentNetworkInfo ("en0", out dict); | |
if (status == StatusCode.NoKey) | |
return ""; | |
var bssid = dict [CaptiveNetwork.NetworkInfoKeyBSSID]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Runtime.InteropServices; | |
using System.Threading; | |
using MonoTouch; | |
using MonoTouch.AVFoundation; | |
using MonoTouch.Foundation; | |
using MonoTouch.UIKit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public override void ReceivedRemoteNotification (UIApplication application, NSDictionary userInfo) | |
{ | |
processNotification(userInfo, false); | |
} | |
void processNotification(NSDictionary options, bool fromFinishedLaunching) | |
{ | |
//Check to see if the dictionary has the aps key. This is the notification payload you would have sent | |
if (null != options && options.ContainsKey(new NSString("aps"))) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Source: http://davidsonblake.wordpress.com/2014/05/29/send-mms-with-image-attachment-using-xamarin-ios/ | |
void SendMMS () | |
{ //Init View Controller | |
var messageController = new MFMessageComposeViewController (); | |
//Verify app can send text message | |
if(MFMessageComposeViewController.CanSendText) | |
{ | |
messageController.Body = "Here's an image for u 2 n joy."; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public override bool FinishedLaunching (UIApplication app, NSDictionary options) | |
{ | |
UIUserNotificationType notificationTypes = UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound; | |
var settings = UIUserNotificationSettings.GetSettingsForTypes(notificationTypes, new NSSet (new string[] {})); | |
UIApplication.SharedApplication.RegisterUserNotificationSettings (settings); | |
UIApplication.SharedApplication.RegisterForRemoteNotifications (); | |
return true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Register ("AppDelegate")] | |
public partial class AppDelegate : UIApplicationDelegate | |
{ | |
UIVisualEffectView _blurView = null; | |
public override void OnActivated (UIApplication application) | |
{ | |
try { | |
if (_blurView != null) { | |
_blurView.RemoveFromSuperview (); |