Coder Social home page Coder Social logo

xamarin.plugins's People

Contributors

alanspires avatar cjlotz avatar jamesmontemagno avatar jongheonchoi avatar julien-mialon avatar lyra2108 avatar magic73 avatar mattleibow avatar pirhano avatar sebfia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xamarin.plugins's Issues

Adding attachment on Android causes Error: E/JavaBinder( 6904): !!! FAILED BINDER TRANSACTION !!!

Running on Android 5.1.1, Google Nexus 6, Project compiled with SDK v23 (6.0).
Version 2.2.1 Produces this error:
E/JavaBinder( 6904): !!! FAILED BINDER TRANSACTION !!!

Simple example of what fails:

public static bool sendEmail(this IEmailTask emailTask, string to, string cc, string subject, string body, string attachment = null) {

            if (emailTask.CanSendEmail)
            {

                var emailBuilder = new EmailMessageBuilder()
                  .To(to)
                  .Cc(cc)
                  .Subject(subject)
                  .Body(body);

                if (attachment != null)
                    emailBuilder.WithAttachment(attachment);

                var email = emailBuilder.Build();

                emailTask.SendEmail(email);

                return true;
            }

            return false;
 }

Information Needed For Swag Bag

I first want to personally thank you for creating a Plugin for Xamarin for our holiday contest. To get your exclusive Xamarin Swag Bag out to you I just need a bit more information from you. If you can email: [email protected] with the following information we will get the bag out to you.

Name
Street Address
City, State, Zip Code
Country
Phone Number
The URL to this repo

Thank you again and I hope to see even more plugins from you in the future. Always feel free to reach out if you need anything.

Question: WinStore Version?

Are you able to ship a blank one so it fits in the PCL profile? Also, can it use the same implementation of your WinPhoneRT?

CanSendEmail always returns false?

If I download this repo and run the sample project on Android, no email can be sent because the CanSendEmail property is false. Is there something I am missing about how to setup the project?

Messaging does not work if there's a BackgroundAgent

I've been having this issue since I started using Xam.Plugins.Messaging:

  • If I add the plugin reference only to my main WP project, it does not work, it dies with a NotImplementedException
  • If I add the reference to the BackgroundAgent too, it works, but then the Windows Store won't accept the XAP, saying the BackgroundAgent uses restricted APIs (mobility cannot be used in a background service).

What would be a simple solution in this case?

Incorrect assembly for Android in NuGet package v3.2.1?

Either the Android assembly in v3.2.1 of the NuGet package is mixed up with the PCL assembly, or I must be misunderstanding something. See the screenshot from a debug session running on my Android device, showing the EmailMessenger implementation in my Android project throwing NotImplementedException. Looking through the code, it seems like this exception should be thrown in the PCL implementation, but not in the Android implementation.
xam plugins messaging notimplementedexception

bcc going into cc box

Hello,

Thank you for the great plugin.

However when I try to add addresses with the emailbuilder to the bcc box they are added to the cc box.

Is it possible to use HTML Table tag inside BodyAsHtml on iOS/Android

    public void SendForm(string to, string subject, List<string> data, string cc, List<string> bcc, List<string> filePath) {
        var emailTask = MessagingPlugin.EmailMessenger;
        var email = new EmailMessageBuilder ();

        email.To (to);
        email.Subject (subject);
        email.BodyAsHtml ("<table><tr><td>T1</td><td>T2</td></tr><tr><td>T3</td><td>T4</td></tr><tr><td>T5</td><td>T6/td></tr><tr><td>T7</td><td>T8</td></tr><tr><td colspan=\"2\">span 2</td></tr></table>");
        emailTask.SendEmail (email.Build ());
    }

I have tried something like this on my native side (I am building a cross-platform application). But I cannot see the table generated inside Gmail or Native email apps on my ASUS Zenfone 2 only the content of the table (just like "T1T2T3T4T5T6T7T8span 2".

Naming Optimization

Hey there! This is looking great.

For the name of the NuGet package I would go with:

"Messaging Plugin for Xamarin and Windows"

This makes it easy to read through all of the plugins :)

Optimization: Remove MessagingContext

Love the concept behind the messagingcontext, however this limits the plugin in the fact that it can not be used from a portable class library.

You should be able to completely remove the MessagingContext though.

On android you could use: Android.App.Application.Context.StartActivity

on iOS you could use: UIApplication.SharedApplication.KeyWindow.RootViewController.View

If for some reason that is not enough, I would recommend that you have a static Init() method on your iOS and Android implementations that actually take in your UIViewController or Activity and then check against null. This is also a good way to do it if that application context and sharedapplication rootviewcontroller are not sufficient.

CanSendEmail always comes false

I am trying to use some of your code to send email from my shared project instead of platform specific. Not sure which code I need to use to send from shared project PCL in Xamarin.Forms. Can you help me?

iPad on iOS 8+ CanMakePhoneCall issue

When running on an iPad with iOS 8 and above, CanMakePhoneCall returns true, even if the device cannot make a phone call. The actual attempt at placing a call then does nothing.

Bug: Presenting controllers in IOS when using Xamarin.Forms might not work

When the UI layout is a Xamarin Forms NavigationPage -> Modal NavigationPage I get the following warning when trying to send an email:
Warning: Attempt to present <MFMailComposeViewController: 0x15591e00> on <Xamarin_Forms_Platform_iOS_PlatformRenderer: 0x159978d0> whose view is not in the window hierarchy!

I suspect that it will also occur in other Xamarin Forms UI layouts too.

Please allow custom setting of UIViewController to present email view on iOS

It appears that there has been work to fix a problem on iOS where a call to CrossMessaging.Current.EmailMessenger.SendEmail() was failing and producing: Warning: Attempt to present <MFMailComposeViewController> whose view is not in the window hierarchy! - as discussed in closed issue #24
However, I am using version 3.2.1 of the Xam.Plugins.Messaging NuGet package, and still encountering this issue - please see: http://stackoverflow.com/questions/40273884/how-to-reset-prism-for-xamarin-forms-view-navigation-stack
I have gotten around this problem by modifying the MessagingExtensions class in Plugin.Messaging.iOSUnified, as follows:

    private static UIViewController _messagingViewController = null;
    private static readonly object messagingControllerLocker = new object();

    public static void SetMessagingViewController(UIViewController controller)
    {
        lock (messagingControllerLocker)
        {
            _messagingViewController = controller;
        }
    }

    public static void PresentUsingRootViewController(this UIViewController controller)
    {
        if (controller == null)
            throw new ArgumentNullException(nameof(controller));

        UIViewController visibleViewController = null;

        lock (messagingControllerLocker)
        {
            visibleViewController = _messagingViewController;
            _messagingViewController = null;
        }

        visibleViewController = visibleViewController ?? GetVisibleViewController(null);
        if (visibleViewController == null)
        {
            throw new InvalidOperationException("Could not find a visible UIViewController on the Window hierarchy");
        }
        visibleViewController.PresentViewController(controller, true, () => { });
    }

So now I call SetMessagingViewController() with a UIViewController that I have created just before I call SendMail(), but that feels like kludge; and I would like to migrate away from my custom version of the Plugin.Messaging.iOSUnified library...

Can you add a supported way of doing this?

Unable to perform call on iOS

Hi,

I'm unable to perform a call on iOS. I always get an exception sayin the NSString couldnt be parsed.

I also tried removed whitespaces and signs like "+" from the number but nothing worked.

Any ideas?

AutoDial in IOS and UWP

Hello,

Can you use the AutoDial property in IOS and UWP projects?

In the messaging plugin there's only a reference to Android.

Thank you

Opens app select instead of going directly to default mail app on Android?

Using this simple convenience method:

Device.OpenUri(new Uri("mailto:[email protected]"));

The default email app is launched as expected.

Using the plugin:

var emailMessenger = CrossMessaging.Current.EmailMessenger;
if (emailMessenger.CanSendEmail)
{
     emailMessenger.SendEmail("mailto:[email protected]", "", "');
}

Seems to launch a more general text share intent (it's using the simple API there, but even when using the builder and filling all cc, bcc, etc fields, it still doesn't launch the default app).

Is there something I'm missing?

Add attachments on WP8.1

Hi,

first of all, thanks for your efforts on this project.

Since WP8.1 does support email with attachments (via EmailMessage and EmailManager), I wonder if you can update the library and add support for attachments on WinPhone.

Regards,
Michele Noberasco

Optimization: Removing Multiple Interfaces

Ideally I would say that this could be 3 plugins... 1 for each Interface to be honest such as:

Phone Call Plugin for Xamarin
SMS Plugin for Xamarin
E-mail Plugin for Xamarin

However if keep them all in 1 Messaging plugin for Xamarin (which I think is alright) I would just have 1 interface. There is no real need from what I see to have 3.

You could just have IMessaging and that is it with all of them. Seems to add complexity for using the plugin.

Trouble with attachments in UWP app

When I use the EmailMessageBuilder().WithAttachment() method in a PCL library, the signature is string filePath, string contentType, but when I run it, I get a PlatformNotSupportedException that says, "User EmailMessageBuilder.WithAttachment(Windows.Storage.IStorageFile file). overload instead.

The file path I provided points to local storage. I don't know if that's part of the problem. Also, none of the docs mention contentType, so I set it to mime type text/csv.

My ultimate goal is to get this running on an iPad, so perhaps this is just an issue with UWP? Thank you in advance!

Mike
image

image

Feature Request

Can you remove the requirement for an emailaddress not to be null and sms recipient not to be null?

Auto dial issue

I have followed the instructions on here to implement autodialling on Android.

I have the latest version of the plugin yet when I try to add the Settings line it tells me that it doesn't exist.

Am I doing something wrong?

image

not able to attach file

please review my code as I am not able to attach any file in EmailMessageBuilder, Also I need to understand about the ContentType, what should I pass in ContentType?

FileData filedata = await CrossFilePicker.Current.PickFile();
String Path = CrossGetLocalFilePath.Current.GetLocalPath(filedata.FileName);
var emailMessenger = CrossMessaging.Current.EmailMessenger;
if (emailMessenger.CanSendEmail)
{
var email = new EmailMessageBuilder()
.To("[email protected]")
.Subject("Xamarin Messaging Plugin")
.Body("Well hello there from Xam.Messaging.Plugin")
.WithAttachment(Path, "image/jpeg")
.Build();
emailMessenger.SendEmail(email);
}

Make "WithAttachment" method PCL compatible

I was wondering if it would make sense to make the "WithAttahchment" extension method PCL compatible? (Also possibly adding a "SupportsAttachments" property to the EmailMessenger)
This would make it much easier to add attachments to emails in a truly platform independent way.

Attachement in IOS

I am getting this exception on IOS : No overload for method WithAttachment' takes 1' arguments (CS1501)

Text, keyboard and send button quickly disappear after calling SendSms

When I execute the following code:

var smsTask = MessagingPlugin.SmsMessenger;
if (smsTask.CanSendSms)
{
    smsTask.SendSms(phoneNumber, textToSend);
}
else
{
    Debug.WriteLine($"Unable to text {phoneNumber} - Cannot send SMS text at this time");
}

The text dialog is showing, the correct number is in the "To" area, and the text is placed in the text area, however VERY quickly the text area and the keyboard (including the send button) go away. We used slo-mo video to capture that the text WAS indeed passed to the text app and that it all went away, leaving the dialog just sitting there with the number and a cancel button.

Any ideas what could be causing this?

Running XForms 2.3.1.114
Xam.Plugins.Messaging 3.2.1

hardware is iPad Air 2 (but can duplicate on iPad mini) both running iOS 9.3.5
And it works fine on iPhones

Thanks for any help!

How to send email anonymously in backgroud ?

Hi,

I want to send emails in the background without user interaction, even to track if someone wants to authenticate which is not authorized. I already send such information to my Application Insights config in Azure. So I get the info anyway. But for convenience it would be great if I can specifiy a To: (sender) like [email protected] . Currently when the app attempts to send an email the standard android email program choose dialog pops up where a user would have to choose its own email account, which is not the desired behaviour.

thanks,
Eric

Sending Pause and Wait in the number string

This may not be an issue in the sense that it simply may not be supported. Is it possible to get this to work with Pause and Wait symbols eg +643210;034471234 where ; is the same as WAIT for user input. At the moment if you passed that string you'd end up with +643210 appearing on the dial string on android.

If you entered that number in for a contact then you'd see the whole thing on the screen, and then it would work as expected.

Documentation of usage

Hello, before of all, congrats for sharing this amazing plugin. But, I'm having difficult to find the documentation, like how to install, how to setup, anything that help me to get started. Thanks so much!

Android Email Attachments - File Provider "content://" paths not supported

Hi @cjlotz,

I was moving to the Android Nougat style FileProvider to handle my app's attachments and found that on line 74 of Messaging/Plugin.Messaging.Android/EmailTask.cs, the attachment logic always adds in "file://".

var uri = Android.Net.Uri.Parse("file://" + attachment.FilePath);

This causes parsing to fail for the FileProvider "content://" style urls.

Would you accept a pull request to fix this? I was planning to replace this with the following:

var uri = Android.Net.Uri.Parse(attachment.FilePath.Contains("content://") ? attachment.FilePath : "file://" + attachment.FilePath);

Thanks!
Dylan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.