There is no doubt that the practice is better than android,ios in pushing. APNS (Apple push Notification service) is a messaging push from Apple. The principle is. The information that the third-party app will push to the user is pushed to Apple server. Apple server then pus
The principle of push:The working mechanism of push can be simply summed up as: provider refers to the push server for an iphone software, which I will use. NET as a provider. APNS is an abbreviation for Apple push Notification Service (Apple push server) and is Apple's serv
The game now usually has local news, such as 12 or 6 o'clock in the afternoon every day to tell players to enter the game to collect physical strength. This kind of thing does not need the server to push, the client can complete. Unity inside provides the functionality of the local tasks but only iOS support, I started a bit puzzled why Android does not support, when I finished the local Android notice, I d
the startup (NSString);
If initiated by a local notification, the Uiapplicationlaunchoptionslocalnotificationkey corresponds to the local notification object (uilocalnotification) for the startup application;
If initiated by a remote notification, the Uiapplicationlaunchoptionsremotenotificationkey corresponds to the remote
iOS push general principles such as1.Provider: Is the server that provides push for the specified iOS device application (if The iOS device application is a client, then Provider can be understood as a service-side [initiator of the message] ]); 2,APNS:Apple
or backstage.
2, if our app is off the state
If this is the case, we can only get the arguments we want from the launchoptions of the following function
Copy Code code as follows:
-(BOOL) Application: (UIApplication *) application didfinishlaunchingwithoptions: (Nsdictionary *) launchOptions;
The code example is as follows:
Receive notification parameters
uilocalnotification *not
receive remote notification content//IOS 7 Support Required//process the received APNS message and escalate the receipt of the APNS message to the server[Apservice Handleremotenotification:userinfo]; Completionhandler (uibackgroundfetchresultnewdata);}4 Remote Push load1) Size: APNs will refuse to send this message when the load exceeds the specified value2) For
with all kinds of popular mobile operating systems to introduce the implementation of the push technology. Of course, our main goal is to discuss the Android push technology.
One, the push technology of iOS
Apple offers a perfect push for
, select Member Center-certificates, Identifiers profiles-certificates, then select Create Certificate, Types are divided into development and product. Take development For example, select Apple Push Notification service SSL (Sandbox), then next, select the previously generated support Push AppID, and then next, submit the CSR file that you created earlier, The
First, create a certificate1 Click the key icon2 in the menu bar, select: Keychain Access? Preferences? certificate tab, the following two items all select Close3 Generating a certificate request: Keychain Access? Certificate Assistant request a certificate from a certification authority4 Enter two e-mail addresses and a common name. The email address is your registered AppleID.A) Common name enter the name you registered on the Apple website, other names have not tried, do not know the line.b)
There is no doubt that the practice is better than android,ios in pushing. APNS (Apple push Notification service) is a messaging push from Apple. The principle is that third-party applications will be pushed to the user's information pushed to the Apple server, the Apple server through a unified system interface to
This is a creation in
Article, where the information may have evolved or changed.
Here's an example of an iOS message push implemented in the Go language
Package Mainimport ("FMT" "Github.com/virushuo/go-apns" "OS" "Time") Func main () {APN, err: = Apns. New ("Apns_dev_cert.pem", "Apns_dev_key.pem", "gateway.sandbox.push.apple.com:2195", 1*time. Second) If err! = Nil {fmt. Printf ("Connect error:%s\n", err
other development is not much to say, directly say and push related.Open the bundle identifier option for the Info.plist file to fill in the app ID to configure the push certificateAPP ID fill inClick on Project, go to build Setting interface, swipe down, go to code Signing configure certificateConfiguring certificatesNeed to modify the app's capabilities in Xcode to open remote notificationsOpen remote no
] init]; }); return instance;} Push processing [registration message notification]-(void) Registerlocalnotification: (uiapplication*) application{ Application.applicationiconbadgenumber = 0;//Clears the number on the app iconKey: Plus version of control # if __iphone_os_version_max_allowed >= __iphone_8_0//The following line must only run under IOS 8. Th
Document directory
(3) hybrid mode
IOS push is implemented in the following steps:
Create push SSL Certification
Register the push function on the IOS client and obtain the devicetoken
Use provider to send push messages to
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.