Embodiment
With reference to the accompanying drawings and examples, the embodiment to the present invention is described in further detail.Implement below
Example is used to illustrate the present invention, but is not limited to the scope of the present invention.
In order to overcome application program in the prior art not consider the demand of user, regardless of any ejection login frame in occasion ground,
The problem of caused reduction user is to the loyalty of the application program and degree of liking, the present invention provides a kind of login of application program
Method.
Fig. 1 shows the schematic flow sheet of the login method of the application program of the embodiment of the present invention, as figure shows, including:
S1, the operation scenario based on user, set certain amount registration conditions;
S2, the login frame for creating each registration conditions of correspondence;And
S3, when trigger registration conditions when, eject to should registration conditions login frame.
The present invention sets registration conditions by the operation scenario based on user, solves and ejects login frame at random regardless of occasion
The problem of influenceing Consumer's Experience, while the login frame by creating each registration conditions of correspondence, solves that all login frames are identical to lead
Family of applying can not effectively distinguish different operating scene, or even the problem of aestheticly tired.
In one embodiment, the application program is for playing live Stream Media Application program.
Streaming Media, is called streaming video, is the media broadcast when passing, is multimedia one kind.Broadcast when passing and refer to media
Provider is at " simultaneously " of transmission over networks media, and user one side constantly receives and watched or listened to the media being transmitted.
" stream " of " stream " media refers to the transmission means (mode of stream) of this media, and does not imply that media in itself.
Live is a kind of entertainment form of current popular, and main broadcaster is by live platform application direct broadcasting room, you can exist at any time
Carried out in direct broadcasting room it is live, user can main broadcaster carry out it is live when, watch that main broadcaster's is live in direct broadcasting room.
In one embodiment, the registration conditions in the step S1 include:When user interacts or logged in main broadcaster
During the individual center of application program, login frame is ejected.
In one embodiment, user and main broadcaster interact including:User pays close attention to the direct broadcasting room of main broadcaster, given a present to main broadcaster
Thing, in main broadcaster room send barrage and main broadcaster's live broadcasting reminding.
After user pays close attention to the direct broadcasting room of main broadcaster, the information of the direct broadcasting room is to be attributed in the personal information of user, Yong Hu
When next time opens application program, the direct broadcasting room can be quickly found by the concern column in personal information.
It is so-called to be given a present thing to main broadcaster, i.e., the behavior for evaluating main broadcaster's popularity value is sent to main broadcaster, present is not limited to charge or exempted from
Take.
Main broadcaster's live broadcasting reminding, for remind user main broadcaster of interest/start it is live.
In the present invention, the operation scenario of user is different, and login frame is also different, and user can be strengthened to difference by so setting
The familiarity of operation scenario.
For the consideration of use habit, the screen of most of Intelligent mobile equipment (such as mobile phone or panel computer) is rectangular
Shape, at conventional use situation (such as browse webpage, using chat software or listen song), at the display interface of Intelligent mobile equipment
In portrait layout state, but when browsing video or playing game, the display interface of Intelligent mobile equipment is in transverse screen state.Due to
There is difference in the engineer's scale of display interface pop-up or icon in portrait layout state and transverse screen state, therefore prior art usually needs
Pop-up or the icon of two kinds of engineer's scales will be pre-set, bothered very much.
In one embodiment, the step S3 further comprises:
When triggering registration conditions and current display interface and being in portrait layout state, eject to should registration conditions login
Frame.
In one embodiment, the step S3 further comprises:
When triggering registration conditions and current display interface is in transverse screen state, current display interface is adjusted to portrait layout shape
State;And
Eject to should registration conditions login frame.
In one embodiment, the step S3 further comprises:
When triggering registration conditions, the figure layer in current display interface is confirmed.Figure layer, is like containing text generally
The film of the element such as word or figure, is stacked together in order a sheet by a sheet, combines to form the final effect of the page.Figure layer can
So that the element on the page to be accurately positioned.Text, picture, form, plug-in unit can be added in figure layer, can also be nested again inside
Figure layer.
The new figure layer for showing login frame is created, by top layer of the new figure layer as current All Layers, when
Figure layer for it is nontransparent when, the figure layer positioned at last layer will cover next layer of figure layer, that is to say, that the figure layer positioned at top layer will be by
User observes directly.
Ejected in the new figure layer it is described to should registration conditions login frame.
It by being shown login frame as the superiors, can observably remind user to carry out register, improve aobvious
Show efficiency.
In one embodiment, when screen is portrait layout ,-(void) showLoginWithType is directly invoked:(int)
type completion:(void (^) (BOOL)) completion functions, are ejected in login frame, the function, type represents bullet
Go out the type of input frame, different type values represent the type of different login frames, and completion is the readjustment of a function,
The callback code block of a function is represented, completion is made up of the sentence of a plurality of execution, and completion is typedef
void(^UserManagerLoginAlertBlock)(BOOL isSucceed,BOOL isCancel,NSString*
message);Sentence.
Call back function is exactly a function called by function pointer.If you assign the pointer (address) of function as ginseng
Number passes to another function, and when this pointer is used to call the function pointed by it, we just say that this is call back function.
Call back function is directly invoked by the realization side of the function, but when specific event or condition occur by an other side
Call, for being responded to the event or condition.
In one embodiment, type=0, represents the login frame ejected during normal operations, for example, send fish ball, hair barrage,
Neck fish ball (fish ball is the integration that live platform rewards user) etc.;
Type=1, represents the login frame clicked on and ejected during concern room;
Type=2 represents the login frame for operating and being ejected before prompting of starting broadcasting.
In one embodiment ,-(void) showLoginWithType:(int)type completion:(void(^)
(BOOL)) compiling procedure of completion functions is as follows
1) AppDelegate*dele=(AppDelegate*) [[UIApplication is used
sharedApplication]delegate];Function command, obtains the agency of application program, and agency is a kind of right in iOS
As for realizing some functions.
2) UIViewController*topViewController=is used
dele.window.rootViewController;On function command, the window for obtaining agency
rootViewController
3) using topViewController=[topViewController tvc_topViewController];Obtain
The controller of top is obtained, tvc_topViewController functions are used to obtain tvc_topViewController controls
Device.
In view of playing during frame, there is other bullet frames or floating layer, therefore traversal source is on window
The uppermost controllers of rootViewController, then bullet layer is added on uppermost controller, if there is
PresentViewcontroler, will play frame and loads on this presentViewcontroler controller, can so protect
The level of bullet layer is demonstrate,proved topmost.
In one embodiment, tvc_topViewController functions include:
Current controller object UIViewController*topViewController=self is obtained using order;
Function while (topViewController.presentedViewController) while is checked for
presentedViewController;
If presentedViewController controllers are present, this presentedViewController controls
Device processed is exactly the controller of top.
4) to obtain and can create login frame to use this top controller as parameter after the controller of top layer, establishment is stepped on
The function for recording frame is self.loginAlertView=[[DYLoginAlertView alloc] initWithVC:
viewController completion:^ (BOOL isSuccess, BOOL isCancel), the compiling procedure of the function
It is
4.1)-(instancetype)initWithVC:(UIViewController*)vc completion:(void
(^) (BOOL isSuccess, BOOL isCancel)) completionBlock this be one include completionBlock
Call back function, completionBlock is some things for needing to do after this function call is finished
4.2) using sentence self=[super initWithMaskBackground:YES];Call the self-defined of parent
Building method
4.3) the various controls at interface, such as UIButton, UILable, UIView are added below
4.4) finally according to the self-defined building method of apple language the characteristics of needs to perform sentence return self
4.5) disappeared if logged on frame, use order selfWeak.loginAlertView=nil;Login frame is emptied, is made
Login frame is set to nil
Step 4) have the advantages that:
A readjustment is defined using block, it is only necessary to which the incoming parameter in outside and a readjustment can just eject one
Individual landing frame;
This function write is a customized building method, can call the self-defined building method of parent, this
Sample can just inherit some initial methods performed by parent, without repeating to write a code again;
The bullet frame added according to top controller on the controller of this top, advantage of this is that any
Interface only needs to invocation step 4) (instancetype) initWithVC:(UIViewController*)vc
completion:(void (^) (BOOL isSuccess, BOOL isCancel)) completionBlock functions just can be with structure
A bullet frame is made, construction is greatly facilitated and plays frame.
In one embodiment, the present invention also provides a kind of entering device of application program, including:
Registration conditions module, for the operation scenario based on user, sets registration conditions;
Login frame module is created, the login frame for creating each registration conditions of correspondence;And
Eject login frame module, for when trigger registration conditions when, eject to should registration conditions login frame.
In one embodiment, the registration conditions include:When user and main broadcaster interact or login application program
During individual center, login frame is ejected.
In one embodiment, the ejection login frame module is additionally operable to, and when triggering registration conditions, is confirmed currently displaying
Interface be in portrait layout state, eject to should registration conditions login frame.
In one embodiment, the ejection login frame module is additionally operable to, and when triggering registration conditions, confirms current layer
Number and order;
The new figure layer for showing login frame is created, by top layer of the new figure layer as current layer;And
Ejected in the new figure layer it is described to should registration conditions login frame.
In one embodiment, the present invention discloses a kind of computer program product, and the computer program product includes depositing
The computer program on non-transient computer readable storage medium storing program for executing is stored up, the computer program includes programmed instruction, when described
When programmed instruction is computer-executed, computer is able to carry out the method that above-mentioned each method embodiment is provided, for example including:
S1, the operation scenario based on user, set certain amount registration conditions;
S2, the login frame for creating each registration conditions of correspondence;And
S3, when trigger registration conditions when, eject to should registration conditions login frame.
In one embodiment, the invention discloses a kind of non-transient computer readable storage medium storing program for executing, the non-transient meter
Calculation machine readable storage medium storing program for executing stores computer instruction, and the computer instruction makes the computer perform above-mentioned each method embodiment
The method provided, for example including:
S1, the operation scenario based on user, set certain amount registration conditions;
S2, the login frame for creating each registration conditions of correspondence;And
S3, when trigger registration conditions when, eject to should registration conditions login frame.
Finally, the present processes are only preferably embodiment, are not intended to limit the scope of the present invention.It is all
Within the spirit and principles in the present invention, any modifications, equivalent substitutions and improvements made etc. should be included in the protection of the present invention
Within the scope of.