ios - Implement custom Cancel Button in a SDK -
i want implement payment functionality paysbuy sdk....the problem doesnot have cancel option on user can cancel operation of close after payment has been successful.
by default sdk provides method opens default webview covers whole part of screen..and there no cancel option..
i want add cancel button load payment on specific view..or viewcontroller..i tried using in container view..to load view inside container view , cancel button outside container view ,but when try process,it shows default in full screen webview.also tried creating popup didnot succeed
so, how can load webview of sdk on specific portion of view can put cancel button??
this method sdk provides start service
- (void) callservicewithcurrentview :(uiviewcontroller *) currentviewcontroller invoice:(nsstring *)invoice item:(nsstring *)item amount:(nsstring *)amount paypal_amount:(nsstring *)paypal_amount transfermethod:(nsstring *)transfermethod customerlanguage:(nsstring *)customerlanguage operator_name:(nsstring *)operator_name operator_email:(nsstring *)operator_email operator_mobile:(nsstring *)operator_mobile operator_address:(nsstring *)operator_address operator_detail:(nsstring *)operator_detail; here can see callservicewithcurrentview method shows target currentviewcontroller think loads default in full screen mode on viewcontroller....
here how implemented in swift
paysbuy?.callservicewithcurrentview(self, invoice: "343434343", item: "app fee", amount: "10", paypal_amount: "1", transfermethod: "1", customerlanguage: "e", operator_name: "paysbuy", operator_email: "abc@paysbuy.com", operator_mobile: "0888888888", operator_address: "paysbuy.com", operator_detail: "payment") and delegate method handles response in case of success or failutre
extension paysbuyhelper:paysbuysdkdelegate{ func responsewithresult(result: string!, andinvoice invoice: string!) { //here response of payement println(result) println(invoice) if result == "00" { println("transaction complete , below invoice number") println(invoice) }else if result == "90"{ println("transaction incomplete information") } } } here work have done.... https://drive.google.com/file/d/0bzk4qvqhnqkmvno5ngdpuv9itke/view?usp=sharing
modal controllers presented within frame context of controller deemed define presentation context.
an option have make controller calls callservicewithcurrentview define context modal presentation can used restrict area on screen used.
you in xcode clicking on presenting controller , selecting defines context checkbox. in code can set definespresentationcontext true.
for of use you, need frame presenting controller not full screen. ideal situation controller inside uinavigationcontroller.
options:
1) presenting controller inside navigation controller navigation bar. child controller. screen footprint uses dependent on whether goes under top , bottom bars. a) set controller content not go under top bars. makes frame under navigation bar. b) when call callservicewithcurrentview, add cancel button on navigation bar. c) if set controller define presentation context properly, uiwebview should show under navigation bar , can see new cancel button.
2) if not in navigation controller, rather calling method directly, add child controller inside sub view above put cancel button. have child controller call callservicewithcurrentview. following same mechanism, make child controller define context. modal uiwebview should cover area of child controller.
hope gives options.
Comments
Post a Comment