iOS Development-Tips: Mac Open source small software pushmebaby, what back end, test app push only rely on xcode!

Source: Internet
Author: User

Pushmebaby is a GitHub open source Mac applet, address: Https://github.com/stefanhafeneger/PushMeBaby, it's very simple, When compiling with the app's push certificate (production environment or development environment depending on your situation), and then add the device you want to push to the devicetoken can, measured push real-time excellent.

This is the main program interface:

Only with a little push, the message is pushed to the device, it is a fool-level conscience application, must be the author points 32 praise!

Here to talk about the process of compiling the program to note, drag down from GitHub, Command+b compiled once, found that the error does not pass (Xcode 7.1), because the ioSock.h inside the introduction of

1 #include <coreservices/. /frameworks/carboncore.framework/headers/mactypes.h>

Tip file not found, just replace it with #include <MacTypes.h> compile.

To this step is not finished, you need to import your push certificate into the project, directly downloaded from the developer Center can be,. CER is available, no need to go to another format, after importing, modify the following method in the APPLICATIONDELEGATE.M file in the project:

1- (ID) init {2Self =[Super init];3     if(Self! =Nil) {4         //can be pre-filled with a devicettoken, do not fill it can be manually entered after5Self.devicetoken =@"";6         //here is the push message format, the app receives the actual push effect as follows7         /*8          {9 @ "APs": {Ten @ "alert": @ "This is some fancy message.", One @ "badge": @ "1" A                     } -          } - the content of the alert--is the information displayed in the notification bar. the badge--is the number of messages displayed on the app icon - Other: - sound--received the push of the beep, the value can be found on the Internet, for example: Default -           + PS: Here, I will mention other useful things, can help not to know the friend, can be in the APS peer to add other you need the key value pair, - and iOS8 out after the whole message size can reach 2K (not more than 2k, formerly 256byte), good use can be easily developed, here for example: +          { A @ "APs": { at @ "alert": @ "This is some fancy message.", - @ "badge": @ "1" -                     } - @ "key": @ "value" -          } -          */ inSelf.payload =@"{\"Aps\": {\ "alert\": \ "This is some fancy message.\", \ "badge\": 1}}"; -         //Import Project App push certificate, production environment or development environment depending on the situation toSelf.certificate = [[NSBundle mainbundle] Pathforresource:@"aps_development"OfType:@"cer"]; +     } -     returnSelf ; the}

The above is the content of this share, thank you to watch!

iOS Development-Tips: Mac Open source small software pushmebaby, what back end, test app push only rely on xcode!

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.