Skip to content

Native dialog support for Android, iOS, BlackBerry and HTML5.

License

Notifications You must be signed in to change notification settings

PlutoniumBytes/extension-nativedialog

 
 

Repository files navigation

#extension-nativedialog

Native Dialog calls for OpenFL

This is a simple "Native Dialog" API implementation. So far it implements the "showMessage" and the "confirmMessage" function, but the extension will add more features like "showMultipleOptions".

Pull requests and comments are appreciated.

###Simple use Example

// This is a simple example that shows how to une the extension-nativedialog extension.

import extension.nativedialog.NativeDialog;

class SimpleExample {

	function new(){

		// setting onShoeMessageClose, onConfirmMessageOk and onConfirmMessageCancel is optional.

		NativeDialog.onShowMessageClose = function() { 
			trace("The user has pressed the 'OK' button.");
		}

		NativeDialog.onConfirmMessageCancel = function () {
			trace("The user has pressed the 'No thanks' button :(");
		}
		
		NativeDialog.onConfirmMessageOk = buyWaterproofTeaBags;

		showMessage();
	}

	function tellSomething(){
		NativeDialog.showMessage("There was an error","Your request failed. Please check your internet conenction and try again.", "OK");
	}

	function askSomething(){
		NativeDialog.confirmMessage("Special offer","Do you want to buy some waterproof tea bags?", "Yes!", "No thanks");
	}

	function buyWaterproofTeaBags(){
		// do something here...
	}

}

###How to Install

haxelib install extension-nativedialog

###License

The MIT License (MIT) - LICENSE.md

Copyright © 2015 SempaiGames (http://www.sempaigames.com)

Author: Federico Bricker

About

Native dialog support for Android, iOS, BlackBerry and HTML5.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 34.1%
  • Haxe 23.7%
  • Java 22.7%
  • Objective-C++ 17.2%
  • Shell 2.3%