Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As <a href="https://stackoverflow.com/users/225589/gonzalo-larralde">Gonzalo</a> mentions in the comments, it looks like a notification is being posted with the name <code>BluetoothAvailabilityChangedNotification</code>.</p> <p>Cocoa's notifications system is based around NSNotificationCenter, which maintains a list of observers and forwards notifications based on names, which are simply NSStrings. It is very likely that you can receive notifications if you call:</p> <pre><code>[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(bluetoothAvailabilityChanged:) name:@"BluetoothAvailabilityChangedNotification" object:nil]; </code></pre> <p>And implement the method:</p> <pre><code>- (void)bluetoothAvailabilityChanged:(NSNotification *)notification { // maybe [notification userInfo] has some useful info... } </code></pre> <p>You might not receive any notifications if GameKit is using a separate notification center object.</p> <p>Does this count as private API? I would say it's no worse than parsing your console output. You are not calling methods on undocumented classes, you are passively observing notifications posted with a given name.</p> <p>Of course, Apple's opinion is the only one that matters. If I were in your shoes, I would make sure that:</p> <ol> <li>your app functions correctly if the notification is never posted (because a future iOS might not post it, or you might have to remove the code and resubmit without it);</li> <li>your app makes no assumptions about the NSNotification's <code>object</code> or contents of its <code>userInfo</code> dictionary (because whatever they contain today might change in the future).</li> </ol> <p>Alternatively, you could figure out a way to intercept your own app's STDOUT and STDERR (any solution that works on generic UNIX may work on iOS) and watch the text for relevant log messages.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload