You need to sign in to do that
Don't have an account?
IanHulme
Execute Apex in Native iOS App
Hi All,
In the Hybrid app you can use Javascript to run apex to send pdfs, for example:
sforce.apex.execute("inspections","sendPdf",{email:$email, inspId:$inspId, inspAssId:$inspAssId});
Is it possible to run this sort of code from a native app, or would I have to build and email the pdf natively on the device.
Many Thanks,
Ian
I have no experience with mobile development, but as no one is giving you an answer, I might as well share my opinion.
Would it not make more sense to have a REST webservice on the force platform do that functionality ? So that your native application just calls that service with required arguments ?
You likely have the code and functionality somewhere in apex already anyhow.
You can use the REST API approach. You mentioned that In your apex page you are able to send email with attachment using your apex code. I would recomend exposing a REST method on the server side, for example
On the client side, invoke this method (JavaScript/ Apex). For example
This is an example of how to do it. You'll obviously need to implement the client side stuff in Objective C but I'm hoping you get the idea.
Regards,
Gaurav
Thanks for your replys, I'm still trying to figure this one out.
How you said is bang on, but the documentation for converting javascript to objective-c is limited at best.
I though I could do it with triggers and setup an object to hold the email plus relavent IDs, but when it comes to getcontent() to attach to email it fails.
If there is any way round this I'd be happy if some could let me know as it is done then.
but failing that, all i would need to know is how to call an apex class from objective-c.
again, thanks for your help.
Ian
Well, if you expose apex classes as RestResource services like gauravkheterpal posted, you could do a http rest request from objective-c. I have no knowledge about objective c , but i'd assume that is possible and well documentated if you look ingo objective c documentation not specific for force.com integration ?