Push Notifications

Hi,

I was wondering if there was or if there is any plan to include push notification capabilities with Corona. Alternatively, is there any way to send the user a message at a certain time without the app being open (or even if the app is just running in the background).

Thanks.

Currently - I have written a module to use HTTP and check a file on my web server to grab any notifications... works good. Just an idea for you.

Yeah, but if the app is closed or only running in the background, that won't work correct? The app needs to be up and running to make an HTTP request right? Thanks for that suggestion though, I basically want to have a reminder notification like you would have in a to do application or an alarm application. Any suggestions?

I have not had time to test this myself --- but does the Timer() continue to run while in background or does it suspend.

Try wrapping the HTTP request into a continuous timer - have it check every so often and see if it still runs while App is in background.

I would be interested to know if this idea would work.

Hi,
Any update on Push Notifcations ? We desperatly need them : we have done a quick prototype of an app using Corona last week-end (was a startup-weekend, some of you may know the works: 48 hours to design and build a project form scratch), we won a price, now is time for industrialization of the App.
Either Push notifications may appear (is there anyway we can help you guys on that ? We'd be ready to spend free time on that ...) soon, or we'll have to code it back in good old XCode that we wanted to forget about ;).

Thanks,

Phil
Moving Player
Maker of Yslandia MMORPG

Agreed !

Please Carlos !!!

i just thought of a possible workaround, tell me if this would work.

You could set up a server to send the user an email or text alert or something, and then the app will download the information when the user launches it.

does the Timer() continue to run while in background

Corona doesn't support multi-tasking. I'm not sure iPhone even allows a background timer like that, but if so Corona doesn't support that anyway.

ADDITION: I just noticed this in Code Exchange, maybe Corona does support push...
http://developer.anscamobile.com/code/multiplayer-networking

native push is coming --- adding game center makes push noti easier but still a bit tricky coding wise for corona so we can expose the same api if a similar push would exist for android

c

Dear Carlos,

Thanks for your reply. Any chance to get a timeframe regarding this integration, just to know if I spend the next weeks enjoying the Riviera's spring sun or I try to get tanned in front of my Mac ?

Cheers,

Phil

Carlos,

Will push work for both iOS and Android? We have a proposal for an app that would need this. If it is coming soon enough we could look at doing it in Corona SDK.

-Steven

If i can find something that's functional to Apple's push in Android, that meets our requirement yes.

If i can find something that's functional to Apple's push in Android, that meets our requirement yes.

As a follow up to my earlier suggestion of using text messages as a workaround for push notifications, here's info on how to send texts from a web app:
http://stackoverflow.com/questions/432944/sms-from-web-application

Hi,

Can anyone help me how to manage a complex game coding in corona

+1 for push... incidentally, not just push notifications, but push data.

How about XMPP? - http://xmpp.org/

There's a LUA client library called "Verse" ( http://code.matthewwild.co.uk/verse ) which should do the trick, if expat were built into Corona. I'm happy to help out on the integration if you want.

@pradeep: Not sure why you thought this is the right place to post your question. I would point you to ask in the Newcomer's Forum, but a question that broad can only be answered with "click Resources at the top of the page and read that."

Any news about push notification and when it will be available?

@anyone

Any news on push notifications?
How about badges?

A project I have scheduled is aching for this. Otherwise, it's back to Obj-C for me.

Any update on push notification ?

Yes any updates on this, please?

+1 for OS notification :)

Any news or time frame for the push notification?

Carlos?

+1 for Push Notifications

+1 for native push notification.

Currently the accepted work-arounds for my team are:

1.) Setup each Corona App as a server listening on port X for incoming messages, and respond accordingly based on the message. (Downside: we are not guaranteed that port X is open on a particular network. We can aggressive scan the 65000 ports for open ports but this is impractically slow, and still does not guarantee another port being open.)

2.) Each Corona App polls a web server/application/service every T amount of time for a message, and respond accordingly based on the message. (Downside: works as long as you have internet access on the device running Corona App, but does not scale well once you have massive amounts of users.)

---------------------

We currently utilize option #2, and are wondering what kind of implementation native push notification would provide that addresses the two problems from above?

@zeltice Very cool info thanks.

+1 for this. Any workaround would be ok for now.

Here is code to implement push notification using approach #1 I described above.

Code was updated from Matthew Pringle's TCP server code at http://developer.anscamobile.com/reference/index/networkrequest . I fixed syntax errors, added more comments, and modified code allow for retrieval of entire communication batches, not just 2 lines.

main.lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
local socket = require("socket");
 
local tcpServer;
 
local function createTCPServer( port )
        -- Create Socket
        local tcpServerSocket, err = socket.tcp();
        local backlog = 5; -- Max number of accepted connections to server
 
        -- Check Socket
        if tcpServerSocket == nil then 
                return nil, err;
        end
 
        -- Allow Address Reuse
        tcpServerSocket:setoption( "reuseaddr" , true );
 
        -- Bind Socket
        local res, err = tcpServerSocket:bind( "*" , port );
        if res == nil then
                return nil, err;
        end
 
        -- Check Connection
        res, err = tcpServerSocket:listen( backlog );
        if res == nil then 
                return nil , err;
        end
 
        -- Return Server
        return tcpServerSocket;
end
 
local function runTCPServer()
        local tcpClient, tcpClientMessage;
        local completeMessage = "";
        
        -- Set Timeout
        tcpServer:settimeout(0); -- Additional delay between each socket listen event.
 
        -- Set Client
        tcpClient, _ = tcpServer:accept();
 
        -- Get Message
        if tcpClient then
                -- The max allowed time between messages is 10ms, after which the sender is
                -- considered to have finished sending data.
                tcpClient:settimeout(.01);
                
                while true do
                        tcpClientMessage, _ = tcpClient:receive();
                
                        if tcpClientMessage == nil then
                                break;
                        end
 
                        --print("Message: " .. tcpClientMessage);
                        completeMessage = completeMessage .. "\n" .. tcpClientMessage;
                end
 
                -- Get rid of the first char ('\n') which was manually inserted.
                completeMessage = completeMessage:sub(2);
                
                tcpClient:send("I HAVE BEEN PUSH NOTIFIED! DATA RECEIVED: " .. completeMessage);
                tcpClient:close();
        else
                -- Error
        end
end
 
-- Make sure to enable port forwarding for port 8080 on your router, and enable 
-- inbound + outbound for port 8080 on your Windows/Mac firewall.
tcpServer , _ = createTCPServer("8080");
Runtime:addEventListener( "enterFrame" , runTCPServer);
-- tcpServer.close() is done on program exit. Call the close method manually
-- if you're turning off server.

Maybe you can use PubNub?

http://www.pubnub.com/

Any news on push notifications ?
(I mean real push notifications that works even when the application is not running... not like pubnub)

I know ansca team is working on monetization first but when you're creating business app push notification is #1 feature that clients are asking. Selling business apps is part of monetization, right ? We can't wait for it ! Please, dear team, do it for us !!

Thanks !

+1
Yes we want native push notifcation even for iOS only.

Hi,

Just to second that "real" push notifications are a must have for most developments we are asked for right now, that we need to carry on using good sweet ;) old native dev at the moment, and loose the power of cross-platform compilation Corona is giving us.

Phil

Moving Player

+1

hi I would very interested in incorporating verse into corona
can you help with this please

+1

Do we get push notification now ?

Any new status now ?

Not going to make it this release.

We are looking for next release and remember to vote up on our roadmap

c

Thanks for the update Carlos. Makes sense given how much is changing in the upcoming IOS 5.0.

As with the prior IOS upgrades, immediately after the release, the new features will be in high demand by the consumer and first apps to support and make good use will have a good appeal.

It will therefore be nice to see how the roadmap shapes up to match IOS 5 and beyond over the next few months.

Keep well.

Hello Carlos,

Thanks for the heads up. This is so saaad !

Any time frame ? :(

Not having push is the +1 reason we have not switched to Corona.

SIGH

android fixes set us back a few weeks and we had to shift this feature out

read my soon to be posted blog on the situation of the situation

c

Could someone clarify something for me...

I'd like to know if "Push Notifications" might include some kind of "Wake Up" timer for an app... not necessarily data being pushed from a server. That is, might it include a way to have the native OS launch an app at a certain time (and with no internet connection required)? I would like to develop a simple alarm clock functionality for an app idea I have and thus want to know if this kind of "wake up" functionality will be included in the "Push Notifications" that the (brilliant, talented, add more flattering compliments here) Corona Team is planning to implement?

Extra points if you say yes. ;-)

Any news on push notifications (without pubnub) for iOS.

Any have a direct link to Carlos's blog about this?

Ta!

+1 on this -- I'm coming up with more and more scenarios where push notifications are necessary.

This would be *very* nice to have.

Jay

views:5284 update:2011/9/17 17:34:45
corona forums © 2003-2011