Home  >  Article  >  Backend Development  >  An Android or iOS application previously sent a request to domain name A, and now needs to change domain name B. Is there a better solution than repackaging Android?

An Android or iOS application previously sent a request to domain name A, and now needs to change domain name B. Is there a better solution than repackaging Android?

WBOY
WBOYOriginal
2016-08-04 09:19:191305browse

If you repackage, users may not necessarily update the app, so this solution is not very good

Of course, it is best to make the domain name requested by the Android application variable from the beginning of the design, so how to solve this problem? That is, can I download a piece of code to overwrite the local code? Is this a security issue?

Reply content:

If you repackage, users may not necessarily update the app, so this solution is not very good

Of course, it is best to make the domain name requested by the Android application variable from the beginning of the design, so how to solve this problem? That is, can I download a piece of code to overwrite the local code? Is this a security issue?

Okay, you can ask the person who wrote the interface to send a request from domain name A to domain name B, and return the data to you. Haha, I want to ask, is it troublesome to repackage? Don’t understand mobile development

You can request background data once when starting the app. Set a label, if it is 1, load the A address, if it is 0, load the B address.

This happens if you already have an online application. So basically there is only one solution: let the back-end developers work hard, redirect all requests sent to point A to point B, and return the response data. Note: It is best not to cause unnecessary changes in the format of these data. Otherwise, if the fault tolerance is not enough, a crash will occur.

Of course, the application itself also has a way to solve this problem, but it needs to be designed in the architecture in advance. For example, both iOS and Android have some implementation technologies for hot repair. If your APP already has such a structure, you can put the developed patches on the server side, let the APP request point B data, and the APP will automatically download and apply these patches to the APP itself. Then the APP can automatically request point B data.

If you weigh the two situations, you will find that point B has been developed. So the first option is the easiest and fastest.

1. From the server perspective: Let the students on the server configure nginx. It’s a matter of minutes.
2. From the App perspective: Domain name changes should not be very frequent. Personally, I think it should be distributed by push, and then saved on the app side; or , prepare an excuse to obtain a domain name

It seems that it is more labor-saving to solve it on the server side

Repackage and package in minutes, it just requires user update

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn