0

I want to set my iOS app to send PushNotification.

I tried UrbanAirship, but this one is not compatible with ARC.

So i tried to find one in GitHub to install in my host. But i didn't find.

Does anyone meet a Push Notification Provider?

  • 1
    What? I used UA in my ARC app two years ago now! – David H May 15 '13 at 16:09
  • Can u help me? I tried to use UA, but when i add the folder to project, and import UAirship.h and UAPush.h in app delegate, i receive lot of errors, saying its not ARC Compatible. –  May 15 '13 at 16:13
  • Disable ARC on the UA files: http://stackoverflow.com/questions/6646052/how-can-i-disable-arc-for-a-single-file-in-a-project – Sean Kladek May 15 '13 at 16:34
  • when i do this i receive this error: Objective-C automated reference counting was enabled in PCH file but is currently disabled –  May 15 '13 at 16:44
  • 1
    @Thiago Take a look at my answer below, you should be able to get it to compile no problem after that. No need to disable ARC on those files unless you need the UI stuff they provide. – Dan Fairaizl May 15 '13 at 16:44
  • Tks, now it works, the problem was in the UI Folder as u said –  May 15 '13 at 16:49

3 Answers3

0

Just because the UA library isn't ARC compatible doesn't mean you cannot use it in your project.

Did you follow the instructions here

It doesn't look like there is anything special to do to use this static library they provide.

Update

If you download and include the latest library UA provides and drop that into your project, ARC complains about the samle UI stuff they include. Just delete those if you are not using them. Then it compiles just fine.

Dan Fairaizl
  • 2,172
  • 2
  • 28
  • 31
0

I am not familiar with UA so much but, you can do one of the two things in order to solve the issue:

  • Add the UA Classes and make them unARC, put in the settings->Build Phases->Compile sources, the flag: -fno-objc-arc
  • create a provider with a web service. You can follow the article how to create a web service in Ray Articles
NDM
  • 944
  • 9
  • 30
0
 [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
 [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];

this code implement in appdelegate first method.

Use this code for get pushnotification

D.M Patel
  • 145
  • 1
  • 7