Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate appnames for ios and package name for android #339

Open
uloco opened this issue Feb 22, 2023 · 14 comments
Open

Separate appnames for ios and package name for android #339

uloco opened this issue Feb 22, 2023 · 14 comments
Assignees

Comments

@uloco
Copy link

uloco commented Feb 22, 2023

Feature Request

It would be great to have a way to specify different appnames or package names for ios and android without any (com.) prefixing magic happening by upgrade helper.

Why it is needed

Our app does not have a .com domain so our bundle identifier is different than just com.appname.

I ran into multiple issues in the past and also recently, where I used the app name field to put in our app name and did not realize it automatically prefixes it with com. for android.
I had build issues where our package (obviously) could not be found. This is a possible issue a lot of people have, which could easily be fixed.

Possible implementation

Just add two fields to specify the appname for ios and the package name for android without prefixing them with com. on android automatically.

@uloco uloco changed the title Separate appnames for ios and bundle identifier for android Separate appnames for ios and package name for android Feb 22, 2023
@smallsaucepan
Copy link
Contributor

@uloco about to look in to this. Could you please review the solution below? You mention wanting to add TWO new fields? I think only one is required though.

What's your app name? [RnDiffApp____]

Say we add a single "app namespace" field ...

Default values would be:

What's your app name? [RnDiffApp____]
What's your app namespace? [com________]

This would give same result as the tool does now with iOS name RnDiffApp and Android files such as com/rndiffapp/MainActivity.java

Entering custom values for either:

What's your app name? [UpgradeHelper ____]
What's your app namespace? [au.org.mycorp ______]

Would give iOS name of UpgradeHelper and Android files such as au/org/mycorp/upgradehelper/MainActivity.java

@smallsaucepan
Copy link
Contributor

@lucasbento / @pvinis would one of you like to assign this to me? Have forked and will return with a PR.

@pvinis
Copy link
Member

pvinis commented Jul 21, 2023

feel free to open up a PR 👍

@smallsaucepan
Copy link
Contributor

Merged by @pvinis. You happy to close this @uloco ?

@uloco
Copy link
Author

uloco commented Jul 27, 2023

On vacation right now and can't test. Will come back to this next week

@uloco
Copy link
Author

uloco commented Jul 31, 2023

Unfortunately this fix does not solve my problem. Our android package name is not the same as just package.appname because it has a suffix also. I would really just let us enter two completely separate input fields for both platforms since we could also just specify two completely different package names in reality.

For example our iOS app is called Smokeless and our android package name is world.smokeless.android.
I can't use it as is with the current change (or don't know how)

@pvinis
Copy link
Member

pvinis commented Jul 31, 2023

i wonder if something like this would work for you.

Screenshot 2023-07-31 at 14 15 32

if not, I'm not sure exactly what the issue is. could you give specific examples and the steps you have to do now manually in order for the upgrade-helper to work for you, so we can try and make these automatic?

@uloco
Copy link
Author

uloco commented Jul 31, 2023

it would work for android but, what if there is a reference to the ios app in AppDelegate for example?

@uloco
Copy link
Author

uloco commented Jul 31, 2023

In my opinion it would be way easier to understand what parts apply where to just have two separate input fields, one for ios and one for android. What if my iOS app is called "foo" and my android package is "bar.baz.abc"? The ios and android app names / packages don't have to be the same in general.

@smallsaucepan
Copy link
Contributor

Understand what you're getting at @uloco. See below for a possible solution. Placeholder text is displayed below in italics.

Default values would be:

What's your app name? [ RnDiffApp ]
What's your app package? [ com.rndiffapp ]

Entering a value for app name would give:

What's your app name? [ UpgradeHelper ]
What's your app package? [ com.upgradehelper ]

Entering a value for package would give:

What's your app name? [ RnDiffApp ]
What's your app package? [ au.org.mycorp.coolapp ]

This aims to strike a balance between indicating to a novice that changing the app name changes the default app package, and also allows the experienced dev to enter a completely unrelated package name.

Would that solve the issue? Will wait for feedback before proceeding with any further changes.

@uloco
Copy link
Author

uloco commented Jul 31, 2023

don't like the implicit logic in behind what input field is filled or not (ux wise bad in my opinion), but you decide.

feature wise if I can specify two fields that don't affect each other this is fine.

@smallsaucepan
Copy link
Contributor

What would be better ux in your opinion? Remembering it should suit novice users as well. Would welcome your input.

@uloco
Copy link
Author

uloco commented Aug 3, 2023

you could have one input field for app name and a checkbox that says something like "specify app and package name separately" and then enable another input field. if the checkbox is checked then both fields are applied separately without affecting the other. if it is not checked than use your default magic.

And always show for both scenarios how your app and package name are affected with a preview.
Placeholder is not good imo because people could think this is just an example of how to fill the field.
Let me know if there is anything else I could help you with.

@uloco
Copy link
Author

uloco commented Aug 17, 2023

As it is now, it still does not work for android as is. For example when I want to update from 0.71.7 to 0.72.4
and put the following in the input fields:
app name: MyApp
package name: world.myapp.android

The tool points me to edit the MainActivity.java file at path android/app/src/main/java/world/myapp/android/myapp/MainActivity.java but the correct path would have been android/app/src/main/java/world/myapp/android/MainActivity.java (so the last myapp is wrong there)

You should not concatenate both app name and package name at all. just use the package name as is. That's the whole point of separating this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants