don/cordova-plugin-hello

not working in iOS now

hari7777 opened this issue · 2 comments

hi i am use this plugin on iOS but it won't work in only iOS ,,,, but its work in android...... please help me to solve that.. bcz i need to create one custom plugin... i already use this plugin before 1 month ago at that time its worked but now its not fine in iOS... please check and tell

is this running only ondeviceready function.....??
please reply me....

don commented

@hari7777 I tested this with Cordova 5.3.3 and Xcode 7.0.1

Here are the steps I followed

cd ~
cordova create hello com.example.helloapp Hello
cd hello
cordova plugin add https://github.com/don/cordova-plugin-hello

Open ~/hello/www/js/index.js and add these lines inside the onDeviceReady method

var success = function(message) {
    alert(message);
}

var failure = function() {
    alert("Error calling Hello Plugin");
}

hello.greet("World", success, failure);

Save the file

cordova platform add ios
open platforms/ios/Hello.xcodeproj/

Using Xcode, run the project.

screen shot 2015-10-19 at 2 40 50 pm

Note that is a sample project I put together for a presentation on Cordova plugins. The Cordova projects now has a Plugin Development Guide which should have better information about writing plugins.