Skip to content

Add a standardized way to send intents on Android #34

@ferrannp

Description

@ferrannp

Introduction

As you know on Android, you can send intents to open other applications (including Settings), deep linking and more. For example, on Android P, if I was developing the Facebook application, I could give the user the option to open the following screen:

8ac515c7-2576-451a-b7b8-8cb8b21fe08d

Using this intent:

Intent intent = new Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS);
intent.putExtra(Settings.EXTRA_APP_PACKAGE, packageName);
intent.putExtra(Settings.EXTRA_CHANNEL_ID, notificationChannelId);
startActivity(intent);

There is a library out there but only with specific cases https://github.com/lucasferreira/react-native-send-intent/blob/master/android/src/main/java/com/burnweb/rnsendintent/RNSendIntentModule.java (there are too many cases). And to be honest, I think this is quite important (core feature of the platform) to depend on an external library.

The Core of It

I think we should provide a standard way of opening intents in the core. Maybe it makes sense to have it in the Linking module?

Discussion points

  • Should we add it as part of React Native? I think yes.
  • Should be part of Linking module? I think yes but I don't have much knowledge of the core to be 100% sure.
  • This change is Android only

P.S. I am working in a PR that should land soon so you can see it in action + code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🗣 DiscussionThis label identifies an ongoing discussion on a subject

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions