M
M
MaxEpt2015-11-16 18:33:41
Objective-C
MaxEpt, 2015-11-16 18:33:41

What tools should be used to develop an ios application that is closely related to a web server (working with a PHP database)?

Good afternoon! The task is as follows: An application with a list of users, a chat between them, and various notifications.
How to implement everything correctly? How to notify the user about the receipt of new messages (now I'm polling the script on the server at a certain interval)?
The application uses a tab bar, when you receive a message above the icon, you need to display a badge with the number of new messages. Where should the code to do this be placed (and the question above is how to know when new messages arrive).
Who can advise what?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Tikhonov, 2015-11-16
@tikhonov666

Parse

G
German Polyansky, 2015-11-30
@f0r3s1

The code should be placed in the application's main delegate (usually AppDelegate.m) in a function

-(void)application:(UIApplication *)application 
       didReceiveRemoteNotification:(NSDictionary *)userInfo;

Place something like
UIApplicationState state = [application applicationState];
       if (state == UIApplicationStateActive) {
          // do stuff when app is active

       }else{
          // do stuff when app is in background
          application.applicationIconBadgeNumber = application.applicationIconBadgeNumber - 1;  
               /* to increment icon badge number */
       }

You can use the Apple Push Notification Service to notify the user of new messages.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question