Brett
Brett

Reputation: 1781

Can you use CFUserNotification with IOS 5.1

I am trying to get a notification to appear when the app is in the background or suspented, as the LocalNotification does not work, I seen mention the CFUserNotification as a potential solution, but when i include the corefoundation framework to my app the CFUserNotification is still no-where to be found, can someone show me how to include CFUserNotification in my project ?

Upvotes: 0

Views: 1084

Answers (2)

Nate
Nate

Reputation: 31045

If you're not making this for the App Store, you can use private APIs. The way I have used CFUserNotifications is to

  1. Add CoreFoundation.framework to the list of frameworks I link against (maybe this framework is automatically included ... I'm not sure ... I just know that it doesn't hurt to add it explicitly to your project).

  2. The CoreFoundation public APIs still don't have the CFUserNotification functions in the headers, as Justin said. So, you need to manually include a complete CFUserNotification.h header. You can find a copy here. Just copy that whole header file, and include it in your project source directory. Then #import "CFUserNotification.h" where you want to use it.

Then, the compiler will let you access those CFUserNotification APIs. I've done this on iOS 5.0 with success (on a device).

Upvotes: 1

justin
justin

Reputation: 104698

Can you use CFUserNotification with IOS 5.1?

No

Upvotes: 3

Related Questions