Skip to content

Commit

Permalink
android: Fix label of intent filter.
Browse files Browse the repository at this point in the history
This `android:label` attribute is "used when [the app or activity] is
presented to the user as having the capability described by the
filter".  In other words it's a user-facing message -- so the current
value is not at all a good one.

Concretely, in this case, it's used in the OAuth functionality.  So
after selecting account in the browser, user is redirected to the app
with this intent. If multiple apps are capable of taking this intent
(like in our case when both release and debug builds are installed in
the phone), then a pop up is shown by the phone OS, letting user to
select with which app he wants to proceed. And this label is used in
this pop up. `filter_react_native` is totally irrelevant, so change it
to something relevant, which can be used to differentiate both the
apps in the phone.

Fortunately, this message never seems to actually be shown unless two
different things advertise this "capability", which in this case
basically only happens when both the release and debug builds of the
app are installed.  So only us developers of the app actually see it.
Still, no need to have a confusing value like this one.

The default behavior is simply to take `android:label` from the parent
component (here, the activity), or else from the application.  Those
are set nicely to "Zulip" or "Zulip (debug)"; so just leave it at that.

[greg: revised explanation in commit message]
  • Loading branch information
jainkuniya authored and gnprice committed Nov 17, 2018
1 parent eccd02f commit 1237c8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Expand Up @@ -42,7 +42,7 @@
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:label="filter_react_native">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
Expand Down

0 comments on commit 1237c8a

Please sign in to comment.