简体   繁体   中英

Calling an Objective-C method from Javascript

I am new to iOS and I am not getting how to call an objectiveC method from Javascript using web view.

I have already tried this but it didn't work. Additionally, please help me with my objectiveC code.

function IosSuccess(transactionid)
{
alert("Transaction successful,transaction id :" +transactionid);
var ret = jsb.reflection.callStaticMethod("PaymentViewController","TransactionId:",""+transactionid);
}

您不能直接使用JavaScript调用目标c方法,而必须使用JavaScriptCore.framework并创建一个用于回调的接口即可完成所需的任务。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM