Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Contributor
RosendoLSL
Posts: 36
Registered: ‎05-04-2010
My Device: Storm
My Carrier: Verizon

Re: How to programatically send email using Playbook 2.0?

Icocea,

 

Thanks for posting this.  I tried the code but in my case it did not work, is there anything else that needs to be added? Maybe on the configxml file? 

 

Also, I am not familiart with the code "blackberry.transport.RemoteFunctionCall("blackberry/invoke/invoke");" where can I find documentation about it? 

 

Regards,

 

Rosendo

Please use plain text.
Trusted Contributor
lcocea
Posts: 117
Registered: ‎02-29-2012
My Device: PlayBook & Nexus 4

Re: How to programatically send email using Playbook 2.0?

[ Edited ]

Yes, you need to enable the blackberry.invoke feature in the config file for this to work. Check out the discussion in the github link posted by astanley.

Please use plain text.
Contributor
RosendoLSL
Posts: 36
Registered: ‎05-04-2010
My Device: Storm
My Carrier: Verizon

Re: How to programatically send email using Playbook 2.0?

Great this works! Many thanks!

Please use plain text.
New Developer
svzi
Posts: 51
Registered: ‎04-04-2012
My Device: Z30, Z10LE, Q5 & PlayBook
My Carrier: German Provider

Re: How to programatically send email using Playbook 2.0?

I still did not get this to work in the simulator. Must I configure an e-mail account before I can use this feature or will it just not work in the simulator?

 

Cheers,

Sven

---
Developer ReadItNow!, PhotoUpload, WhereIs...?, Magic4Square and OrganizeMe!

http://sven-ziegler.com
Please use plain text.
Trusted Contributor
lcocea
Posts: 117
Registered: ‎02-29-2012
My Device: PlayBook & Nexus 4

Re: How to programatically send email using Playbook 2.0?

[ Edited ]

There is no native email client currently available in the simulator.

Please use plain text.
Contributor
RosendoLSL
Posts: 36
Registered: ‎05-04-2010
My Device: Storm
My Carrier: Verizon

Re: How to programatically send email using Playbook 2.0?

I tested this using an actual playbook device.  The emulator runs to slow in my PC that is why I did not test it there.

Please use plain text.
New Developer
svzi
Posts: 51
Registered: ‎04-04-2012
My Device: Z30, Z10LE, Q5 & PlayBook
My Carrier: German Provider

Re: How to programatically send email using Playbook 2.0?

Thanks for that information. So I just add the code and I hope it works on the actual device.

Thanks for your help!

Cheers,
Sven
---
Developer ReadItNow!, PhotoUpload, WhereIs...?, Magic4Square and OrganizeMe!

http://sven-ziegler.com
Please use plain text.
Contributor
icq782443
Posts: 22
Registered: ‎02-21-2012
My Device: Playbook torch 9800
My Carrier: Telus

Re: How to programatically send email using Playbook 2.0?

Thank you for this. There are some limitations to this solution. Because we are sending the subject and body of the email in the argument, we can only send so many characters. urlencoding the sting shortens this considerably too (consider each space will take up 3 characters when encoded to '%20') From my testing...  I ran into 2 limits:

 

Limit 1. Beyond about 1135 chars. the app is unable to launch the Messages app. The app will bounce in and out of focus and will cause an error 7. This can be overcome if the user already has the Messages app running. Until we hit limit 2.

 

Limit 2. Beyond about 1995 chars. the app just won't be able to pass the message at all. I believe the error was error 35. 

 

The above character counts are approximate. I hope this info helps others. This is still the best solution I have seen. yet. 

Please use plain text.
Trusted Contributor
lcocea
Posts: 117
Registered: ‎02-29-2012
My Device: PlayBook & Nexus 4

Re: How to programatically send email using Playbook 2.0?

[ Edited ]

@icq782443 -- Thanks for the great info. This has also recently been discussed to some extent on github (see link in a previous post) but we were unaware of Limit 2. Cheers!

Please use plain text.
Developer
scrid2000
Posts: 142
Registered: ‎07-27-2011
My Device: Red Z10, 32GB PlayBook, Numerous Android/WP8/FirefoxOS/Other devices
My Carrier: T-Mobile

Re: How to programatically send email using Playbook 2.0?

I must be missing something, I've tried to get this to work and I just can't seem to get it.

Can I not call this with onClick?

 

I've been trying

<script>
function launchMail() {
var remote = new blackberry.transport.RemoteFunctionCall("blackberry/invoke/invoke");
remote.addParam("appType", "mailto:?Subject=SubjectStr&body=" + encodeURIComponent(BodyStr));
}
</script>

<button onclick="launchMail();"/>

 

and a multitude of variations on that with no luck.

Also been trying it for an App World link using a line from the github error discussion:

 

<script>
function getApp() {
var remote = net.flash.navigateToURL.navigateToURL(
new URLRequest("appworld://" + encodeURIComponent(BodyStr)));
}
</script>
<img src="appworld.png" onclick="getApp()"/>

 

And it just hasn't been working. 
Maybe some kind person could help me out? 

-----------------------------------------------------------------------------------------



Please use plain text.