Side Menu item with an email link in Moodle Mobile

Side Menu item with an email link in Moodle Mobile

Arabinda P -
回帖数:13
Thank you, Dani. Appreciate your prompt responses as always!


I will check the PayPal in my Payment Gateway.

We are going Live soon, and we need a small guidance from you!

We want to have a Menu item in Moodle Mobile which when clicked will call native "email" client with pre-populated - "To" address and "Subject Line".

Many mobile apps have this.

Kindly give some guidance, how to achieve this one.

Can this be done completely in Ionic, or we need some change in PHP Web Services?

Is there a sample code, you may kindly point me to?

Thank you.

回复Arabinda P

Re: Side Menu item with an email link in Moodle Mobile

Dani Palou -
Core developers的头像 Moodle HQ的头像 Peer reviewers的头像 Plugin developers的头像

Hi,

I moved your post to a new discussion since it no longer talks about PayPal.

You should be able to achieve what you want using a custom side menu item. To use them, you need either Moodle 3.3 or higher, or having the Moodle Mobile additional features installed.

Go to Site administration > Mobile app > Mobile features and add a new entry in Custom menu items. You should use "browser" as the opening method, and use a mail URL:

https://stackoverflow.com/a/1093942/1455909

We haven't tested if this works, so please let us know if this isn't working for you.

Kind regards,

Dani

回复Dani Palou

Re: Side Menu item with an email link in Moodle Mobile

Arabinda P -

Hi Dani,

The solution from Stack Overflow is not working for me

This is how I put in Mobile features -> Custom Menu Items

Send Email|<a href="mailto:parabindas@outlook.com?subject=My Query">Email Me!</a>|browser


When accessed it's giving error - PDF(<a href="mailto:parabindas@outlook.com?....) not found.

Please guide what to do.

The below are very critical requirements for an App, any help really appreciated.

1) Opening phone Client from App

2) Opening Mail Client from App

3) Opening Social Share from App


Regards

Arabinda

回复Arabinda P

Re: Side Menu item with an email link in Moodle Mobile

Dani Palou -
Core developers的头像 Moodle HQ的头像 Peer reviewers的头像 Plugin developers的头像

Hi,

the second field only needs the URL, not the whole HTML code:

Send Email|mailto:parabindas@outlook.com?subject=My Query|browser

I checked it in a local site and it worked for me.

You can also use the "tel:" protocol to allow doing a phone call. So you can put a link like "tel:123456789". I'm not sure if that's what you meant by opening "Phone client".

Regarding social share, it's not possible to do so in the official app because it requires an external plugin that is not installed in the app (like this one), you'll need a custom app for that.

Kind regards,

Dani

回复Dani Palou

Re: Side Menu item with an email link in Moodle Mobile

Arabinda P -

Thank you, Dani.

It really worked, amazing!

Without changing the Mobile App Code.


Now, how can I have a "Page resource" linked in Menu such as "Terms and Conditions" which natively opens in Mobile App?


I tried the Terms|http://.......|inappbrowser. 

It really looks ugly.


I have created a Page Resource, and Page Resource is inside a Course.

But I want to make it globally available for all with a Link on Menu.

Can I do this using the above method and without having to change the code?


Thank you.




Regards

Arabinda




From: Dani Palou (via Moodle.org) <noreply@moodle.org>
Sent: Monday, January 15, 2018 11:39 PM
To: Arabinda P
Subject: Moodle in English: Re: Side Menu item with an email link in Moodle Mobile
 
Picture of Dani Palou
Re: Side Menu item with an email link in Moodle Mobile
by Dani Palou - Tuesday, January 16, 2018, 3:08 PM
 

Hi,

the second field only needs the URL, not the whole HTML code:

Send Email|mailto:parabindas@outlook.com?subject=My Query|browser

I checked it in a local site and it worked for me.

You can also use the "tel:" protocol to allow doing a phone call. So you can put a link like "tel:123456789". I'm not sure if that's what you meant by opening "Phone client".

Regarding social share, it's not possible to do so in the official app because it requires an external plugin that is not installed in the app (like this one), you'll need a custom app for that.

Kind regards,

Dani


You can reply to this via email.

回复Arabinda P

Re: Side Menu item with an email link in Moodle Mobile

Dani Palou -
Core developers的头像 Moodle HQ的头像 Peer reviewers的头像 Plugin developers的头像

Hi,

there is a type named "app". If you use this type, the app will check if the URL can be opened in the app. If it isn't, it will be opened in browser. If it is, it will be opened in the app. In case of modules, the app navigates to the module through the course or site home.

So you should use the URL of the page (something like mysite/mod/page/view.php?id=39) and use "app" instead of "inappbrowser".

Cheers,

Dani

回复Dani Palou

Re: Side Menu item with an email link in Moodle Mobile

Arabinda P -

Hi Dani,

I tried using below to call "Whatsapp" client from Menu link as per below

https://stackoverflow.com/questions/21500570/start-whatsapp-from-url-href-with-custom-text-content

<a href="whatsapp://send?text=Hello%20World!">Hello, world!</a>
I used in Custom Menu - Share with Friend|whatsapp://send?text=link|browser|en

But, it does not work.

Kindly, let me know, how we can make it work.


Thank you

Regards

Arabinda

回复Arabinda P

Re: Side Menu item with an email link in Moodle Mobile

Dani Palou -
Core developers的头像 Moodle HQ的头像 Peer reviewers的头像 Plugin developers的头像

Hi,

I opened an issue to fix it:

https://tracker.moodle.org/browse/MOBILE-2320

Cheers,

Dani

回复Dani Palou

Re: Side Menu item with an email link in Moodle Mobile

Arabinda P -

Thank you, Dani.

I think it will be really great, if we can have the Social Share URL Scheme - whatsapp enabled!

This is why? I have a customized Moodle Mobile for Learning.

I want to add "Share App with Friends" Menu item - by which the user can directly "send the link" of my Customized Android App from PlayStore to his friends.

And this will really save money for startup companies like us.

I asked an Ionic Custom App Solution to a FreeLancer for enabling "Social Sharing" and he is charging a lot.

Now, if what URL Scheme is allowed, is there in some particular files in Moodle App Codebase, where I can enable WhatsApp, and if you can please easily point to it.

I can make the changes and do a PhoneGap Build for that.

Kindly advise.

Thank you!

Regards

Arabinda

回复Arabinda P

Re: Side Menu item with an email link in Moodle Mobile

Dani Palou -
Core developers的头像 Moodle HQ的头像 Peer reviewers的头像 Plugin developers的头像

Hi,

to enable whatsapp you just need to add "whatsapp" to the list of supported schemes. You can find it in here:

https://github.com/dpalou/moodlemobile2/blob/master/www/core/main.js#L202

Just replicate that line but replace "geo" by "whatsapp".

Please remember that if you work directly with the phonegap build repository you need to apply those changes to the build file.

Kind regards,

Dani

回复Dani Palou

Re: Side Menu item with an email link in Moodle Mobile

Arabinda P -

Hi Dani,

I looked and found that I don;t have "main.js" in my local pull as per below path.

https://github.com/dpalou/moodlemobile2/blob/master/www/core/main.js#L202

I have below pull https://github.com/parabinda/moodlemobile-phonegapbuild/tree/androidnew

This has 3.3 pull.

COuld you please guide, how I can achieve Whatsapp calling from Moodle Mobile 3.3?

I tried Moodle 3.4, but it compiles fine, but gives me White Screen.


Kindly advise.


Thank you

Regards

Arabinda

回复Arabinda P

Re: Side Menu item with an email link in Moodle Mobile

Dani Palou -
Core developers的头像 Moodle HQ的头像 Peer reviewers的头像 Plugin developers的头像

Like I said, if you're using the phonegapbuild repository you need to apply the changes to the build file: build/mm.bundle.js

Cheers,

Dani

回复Dani Palou

Re: Side Menu item with an email link in Moodle Mobile

Arabinda P -

Thank you so much. As you said,

I whitelisted Whatsapp in - build/mm.bundle.js

Brilliant! And it works perfectly! !

For Moodle, Mobile 3.4, please share Phonegap Source repository URL for Github.

I couldn't find it. I would like to build a Custom App using 3.4

Regards
Arabinda