(1) 2 ways to set the status bar--The first way is that we set in the controller, the system by default is given to the view controller to manage, so different view controllers can customize the different status bar as follows:-(BOOL) prefersstatusbarhidden{}-(Uistatusbarstyle) preferredstatusbarstyle{}--if we need to give UIApplication object Management (IOS6 before), you need the following settings:Change the default settings in Info.plist first:The
The lifecycle of an iOS application, and whether the program is running in the foreground or in the background, transforms the state of the application, which is important to the developer. The resources for iOS systems are limited, and applications are not the same in the foreground and in the background. In the background, the program is subject to many limitations of the system, which can improve battery usage and user experience.1. Status of the applicationNot running running program does no
IOS network push notification
Push notifications are initiated by application service providers and sent to the application client through Apple's APNs (Apple Push Notification Server.
The process of pushing notifications can be divided into the following steps:The application service provider sends the message and device token to Apple's APNs server from the server side.APNs searches for the corresponding device on the registered device (iPhone, iPad, iTouch, mac, etc.) based on the device toke
daemon in the background and can execute code, most of the program into this state will stay in this state for a while. The time will then go into the suspended state (Suspended). Some programs after a special request can be long-term in the Backgroud state//suspended suspend program in the background can not execute code. The system automatically turns the program into this state and does not give notice. When suspended, the program is still in memory, when the system memory is low, the system
1. Each application has its own Uiwindow,uiwindow inherited from the Uiview2.uiview face problem: 1. Who controls the switch between UIView? 2. Who manages the UIView life cycle? 3. Who will assemble the data for UIView? 4. Who listens to UIView's events? The answers to the above three questions are: UiviewcontrolleriOS Core class
UIView: Views, things that can be seen and touched on the screen are UIView, such as buttons, text labels, tables
Uiviewcontroller: Internal default has a
appear during the push)
LocalNotification. soundName = uilocalnotificationdefasoundname;
// Push text information (if not set, text is not displayed in the push center. If there is a sound prompt, you must set a sound)
LocalNotification. alertBody = @ "Hello world ";
// Set the push time icon. PS: I don't know how to use this item.
LocalNotification. alertLaunchImage = [[NSBundle mainBundle] pathForResource: @ "3" ofType: @ "jpg"];
/// This item is used to locate which notification is u
, we'll look at this Function. The following two parameters of the main parsing function:
parameters
principalclassname
app ), The class must be uiapplication ( or subclass ) . If nil, uses the uiapplication class as the default value
delegateclassname
uiapplicationdelegate protocol
Summing up the f
Simply put: A first-level view of the found response, if not passed to UIWindow instances and uiapplication instances, if they can not handle, discard this event ...For iOS device users, there are three main ways to manipulate devices: Touch the screen, shake the device, and control the device through a remote controlled facility. The following three types of events are available:1. Touchscreen events (Touch event)2, motion events (motion event)3. Rem
A long time ago to write the demo, now remember the next ~ ~ ~ may be a mistakeGithub:https://github.com/bigshow1949/yfpushtestSteps:1) Add App ID.Apple Developer Center: Identifiers--->app IDs to add an ID, such as my name:yfpushtest, where the ID must be the project bundle Identifier, such as: com. YFPushTest.BigShow.YFPushTest;2) Generate Apple Push certificate (production test)Named for example: COM. YFPushTest.BigShow.YFPushTest, choose the app ID, to choose the one we just created, do not
1) iOS Core class
UIView view, what you can see on the screen is a view, such as: Buttons, text labels, tables, etc.
Uiviewcontroller: The internal default has a view (UIView) that is responsible for managing the UIView lifecycle, assembling data to display on UIView, and handling its events
iOS with MVC mode: Model-view-controller
2) Operation Process
How iOS Works
1. Perform the main function first
2.main function call Uiapplicationmain function
Creat
icon Number Localnotification.applicationiconbadgenumber = 0;
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[Formatter setdateformat:@ "HH:mm:ss"];
NSDate *date = [Formatter datefromstring:@ "15:30:00"];
The time Localnotification.firedate = Date of the notice issued;
}//cyclic notification cycle localnotification.repeatinterval = Kcfcalendarunitday;
Set UserInfo to facilitate the revocation of nsdictionary *info = [nsdictionary dictionarywithobject:@ "name" forkey:@
uilocalnotification
There are times when we need to deal with some local push and small details.
//judged that he was not active in the foreground before sending the push if ([UIApplication sharedapplication].applicationstate,!= uiapplicationstateactive) {//local push uilocalnotification *localnotification = [[Uilo
Calnotification alloc] init]; Localnotification.alertbody = @ "You just finished a trip, go and see the score."
";
Return
}
Print "Connection ok\n";
$payload = Json_encode ($body);
$msg = Chr (0). Pack ("n", 32). Pack ("h*", Str_replace (",", $deviceToken)). Pack ("n", strlen ($payload)). $payload;
Print "Sending message:". $payload. "\ n";
Fwrite ($fp, $msg);
Fclose ($FP);
?>
And then
Here the certificate is ready, and next, we'll create a new test project in Xcode, and note that the bundle identifier for the Setup project must be the same as the app ID built above.
Add code to
identifier cannot be the same, and the URL schemes of item 0 cannot be the same, this needs to be noted .Accessing the custom URL (in test02)Launch another application in the main application by accessing the custom URL: (test is installed, this code is written in another application, such as test02)-(void) viewdidload { [Super viewdidload]; UIButton *btn = [UIButton buttonwithtype:uibuttontypecustom]; Btn. Frame = CGRectMake (+, +, + ); Btn. backgroundcolor = [uicolor redcolor];
, first to developer.apple.com up to download their own created push certificate, certificate column. Download APNs certificate (divided into development and production), download the development of the certificate can be, the app on-line after the service side of the certificate to production on it. Clicking on the downloaded certificate will appear in the keychain.Generate the. p12 file asGenerate a certificate in PEM formatOpen the terminal and enter the directory where you saved the. p12 fil
the clientRemote notification requires a real machine , and you also need to go to the Apple Developer Center to request a certificate: A Real Machine Debug certificate, a remote push certificate (which computer to debug or publish which app), a description of the file certificate (which computer uses which device to debug which app)We can use Pushmebaby to simulate a server, or we can use third-party software to send notifications such as Jpush, etc. The following is the implementation of the
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.