Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

PhoneDialer API's #25

Closed
mattleibow opened this issue Feb 25, 2018 · 6 comments
Closed

PhoneDialer API's #25

mattleibow opened this issue Feb 25, 2018 · 6 comments
Milestone

Comments

@mattleibow
Copy link
Contributor

mattleibow commented Feb 25, 2018

A simple API to open the default dialer, preloaded with a number and name.

static class PhoneDialer {
    static bool IsSupported { get; }
    // should throw a NotSupportedOnDeviceException if the device is not capable.
    static void Open(string number);
}

For the discussion around exceptions, see #19

@mattleibow mattleibow added this to the Preview-1 milestone Feb 25, 2018
@f1nzer
Copy link
Contributor

f1nzer commented Feb 26, 2018

As for me it can be simplified:

static class PhoneDialer
{
    static bool CanOpenDialer { get; }
    static void OpenDialer(string number);
    static void OpenDialer(string number, string name);
}

Just a few moments to clarify:

  • there is no need in Task *Async(), because it seems to be sync everywhere;
  • via this API all we want to do is to open phone dialer, so why do we have Call method? OpenDial() seems more natural;
  • should we take into account CountryIso, or let the user decide?
  • two methods OpenDial(...) can be simplified to a single OpenDial(string number, string name = null) or we can left these two methods?

@mattleibow
Copy link
Contributor Author

Thanks for your feedback. I am really agreeing with you here.

With regards to the methods, we would like to avoid the default parameters as this may make it harder to change in future.

@mattleibow mattleibow changed the title PhoneDialler API's PhoneDialer API's Feb 26, 2018
@jamesmontemagno
Copy link
Collaborator

jamesmontemagno commented Feb 26, 2018

I am thinking that in the Platform we can have "capabilities" instead of each API having a "can do this"

static class Capabilities

static class Capabilities
{
  bool HasTelephony { get; }
}
static class PhoneDialer
{
    static void Open(string number);
}

use:

if(Capabilities.HasTelephony)
   PhoneDialier.Open("+15555555555");

I don't know if we need a name option as I don't think that is handled gracefully.

We should also avoid duplicating words if it is in the class name.

@mattleibow
Copy link
Contributor Author

I think we should move this (Capabilities) discussion to #17 - I have a longer comment there

@f1nzer f1nzer mentioned this issue Feb 27, 2018
5 tasks
@mattleibow
Copy link
Contributor Author

I removed the name parameter as it is just supported on UWP right now.

However, if this is a cool feature, we could probably just add it to the UWP version:

class Dialer {
#if UWP
    void Open(string number, string name);
#endif
    void Open(string number);
}

This way we get a nice feature, but do not add it to the cross-platform API where it is not supported.
Thoughts?

@Redth
Copy link
Member

Redth commented Mar 2, 2018

I think eventually we may add this sort of thing in, but let's stick to things that work everywhere for the most part for now.

@jamesmontemagno jamesmontemagno added the up-for-grabs Implementation from community can be started. label Mar 8, 2018
@Redth Redth added in-progress and removed up-for-grabs Implementation from community can be started. labels Mar 10, 2018
jamesmontemagno pushed a commit that referenced this issue Mar 23, 2018
* added phone dialer api

* fixes according to comments

* Merge branch 'master' into feature/phone-dialer

* Added the UWP SDK references and fix the Android intent logic as StartNewActivity does not exist.

* fixed style errors

* added phone dialer sample

* added phone dialer tests
jamesmontemagno pushed a commit that referenced this issue Mar 26, 2018
* GH-25: Add PhoneDialer API (#37)

* added phone dialer api

* fixes according to comments

* Merge branch 'master' into feature/phone-dialer

* Added the UWP SDK references and fix the Android intent logic as StartNewActivity does not exist.

* fixed style errors

* added phone dialer sample

* added phone dialer tests

* Cleanup exceptions from merge

* Cleanup dial API and is supported

* Cleanup dialers is supported

* Cleanup tests and samples.

* Add phone dialer docs.

* Cleanup UWP

* Add remarks

* Changes based on feedback to cleanup samples.

* Add platform helpers.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants