Joke Collection Website - Public benefit messages - Experience in back-end development of mobile application 3- SMS, email and push services.

Experience in back-end development of mobile application 3- SMS, email and push services.

In the back-end design of app, services such as message push, SMS and email are inevitable. Let's start with personal development experience.

(1) Most importantly, all kinds of pushes must be processed in the queue system, otherwise the response time of the api will be seriously affected.

(2) SMS.

In the past, we used the short message service of Yimei Softcom, but after the three major operators tightened the short message service, the short message delay of Yimei Softcom was very serious. Later, we found this short message service provider, and soon sent short messages to China Unicom, China Telecom and mobile phones (until 20 14+0.24).

If the SMS sent to the mobile phone has not been improved, the last backup plan: send it to Unicom, the SMS sent to the mobile phone will use domestic service providers, while the SMS sent to the mobile phone can only use foreign SMS service providers (sending SMS to the mobile phone abroad costs 30 cents, which is so expensive! ! ! )

Note: sharesdk now provides free SMS verification code service (/sms). During the trial operation, developers will be provided with free SMS verification for each App 10000 times every day.

(3) mail

At first, we used the postfix that comes with the server to send the mail, but we found that the mail was regarded as spam by many mail service providers, and there was no resending mechanism to ensure the accurate arrival of the mail.

Later, I checked the major websites and found that both Zhihu and github use /email service. After reading the document, the price is very reasonable, and there is a free email of 10000 every month, which is very suitable for entrepreneurial companies.

(4) Push service

In this regard, the focus of my consideration is: in the early stage of starting a business, I should use the services of third parties as much as possible, only deal with the business logic itself, and develop products quickly.

Android article:

On the android side, we use three message push mechanisms:

1. Aurora Push, now give up. In the process of using, we found that the mechanism of aurora is a bit strange. Generally speaking, an app has a fixed id in the Aurora server, but in Aurora, the id of the app is notified by broadcasting, and it is actually stated in the document that this id will change from time to time.

2.openfire server. App gets all kinds of messages by connecting to openfire server, but openfire has a mechanism. When the app is connected to openfire, it will automatically disconnect when it is idle, which makes it impossible to maintain the stability of the connection. The cost of modifying this openfire mechanism was too high, and then openfire was abandoned.

3. Baidu push. It has been used for some time now, and the push is timely and fast, and I am quite satisfied with Baidu's push service.

Iphone article:

Apns is the best choice for iphone push. However, if you develop apns service yourself, you will encounter invalid tokens and need to resend them. So you need to maintain a queue and establish a retransmission mechanism. Considering the project time and research and development cost, you will eventually use the service pushed by Baidu.

When the user uninstalls the app on the iphone, the device token will be invalid, so you should visit Apple's feedback server regularly to clear the invalid token.