📘

[iOS] notify.h

2024/01/30に公開

勉強中なので、多分間違ってます。

// 通知の登録
uint32_t notify_register_dispatch(const char *名前, int *トークン, dispatch_queue_t 実行するスレッド, notify_handler_t 実行するブロック);

// 通知の送信
uint32_t notify_post(const char *名前); 

// 受信を停止
uint32_t notify_suspend(int token);

// 受信を再開
uint32_t notify_resume(int token);

// 通知を解除
uint32_t notify_cancel(int token); 
// 通知の登録
int token;
notify_register_dispatch(@"name", &token, dispatch_get_main_queue(), ^(int token) {
	// 通知を解除
	notify_cancel(token);
});

// 通知の送信
notify_post(@"name"); 

これはnameという名前で通知を登録して、nameで指定してそれに通知を送信しています。
一度受信すると、第4引数のブロックが実行されるので、notify_cancelで通知が解除されます。

https://developer.apple.com/documentation/darwinnotify/darwin_notification_api
他にもありますが、使ったことがないのでわかりませんでした。

com.apple
com.apple.
com.apple.%@
com.apple.Accelerate.vecLibU3.4.2
com.apple.AccelerateU1.4.2ZAccelerateZ(SDK_NAME)WEnglishXiphoneosS6.0_
com.apple.AccountSettings.Dataclass.Bookmarks
com.apple.AccountSettings.Dataclass.Calendars
com.apple.AccountSettings.Dataclass.Contacts
com.apple.AccountSettings.Dataclass.Mail
com.apple.acl.text
com.apple.activesync
com.apple.addressbook
com.apple.AddressBook
com.apple.addressbook.migrationdaemon
com.apple.addressbook.person.delete
com.apple.addressbook.person.property.edit.new.save
com.apple.addressbook.person.property.edit.save
com.apple.addressbook.person.property.name.edit.save
com.apple.AddressBook.PreferenceChanged
com.apple.AddressBookS1.0[AddressBookZ(SDK_NAME)T????TFMWK
com.apple.AddressBookUIU1.0.0]AddressBookUIT????Z(SDK_NAME)TFMWK
com.apple.AOSNotification
com.apple.AOSNotificationU1.0.0_
com.apple.apn.managed
com.apple.AppKit
com.apple.AppleJPEGYAppleJPEGT????Z(SDK_NAME)TFMWK
com.apple.applicationaccess
com.apple.AppStore
com.apple.AppStore_
com.apple.AppSupport
com.apple.AppSupportU1.0.0ZAppSupportZ(SDK_NAME)T????TFMWK
com.apple.AQClientRunLoopMode
com.apple.ArtworkCacheS420Z(SDK_NAME)TFMWK_
com.apple.audio.AudioMIDISetup
com.apple.audio.AudioQueueServer
com.apple.audio.AURemoteIOServer
com.apple.audio.codecs.Components
com.apple.audio.CoreAudio
com.apple.audio.CoreAudio.AggregateDevicePlugIn
com.apple.audio.CoreAudio.DefaultInputDevice
com.apple.audio.CoreAudio.DefaultOutputDevice
com.apple.audio.CoreAudio.DefaultSystemOutputDevice
com.apple.audio.CoreAudio.HogMode.Owner-
com.apple.audio.CoreAudio.IOAudio2
com.apple.audio.CoreAudio.pid-%d.%lu.%qd.Telemetry.IOCycle
com.apple.audio.CoreAudio.PreferredChannelLayout.%s.%@
com.apple.audio.CoreAudio.PreferredStereoChannels.%s.%@
com.apple.audio.CoreAudio.VirtualAudio
com.apple.audio.CoreAudioZ(SDK_NAME)TFMWK_
com.apple.audio.OpenALVOpenALZ(SDK_NAME)WEnglishXiphoneosS6.0_
com.apple.audio.remote.%c.%x
com.apple.audio.systemsoundserver
com.apple.audio.toolbox.AudioToolbox
com.apple.audio.Transformer.Owner.
com.apple.audio.Transformer.Owner.Request.
com.apple.audio.units.AudioUnitYAudioUnitT????Z(SDK_NAME)TFMWK
com.apple.audio.units.Components
com.apple.AutoWake.xml
com.apple.bluetooth.power-changed
com.apple.BluetoothManagerU1.0.0_
com.apple.Bookmarks
com.apple.bookmarks.Bookmark
com.apple.bookmarks.BookmarksFileChanged
com.apple.bookmarks.Folder
com.apple.bsd.dirhelper
com.apple.BTServer_
com.apple.Calendars
com.apple.calendars.Attendee
com.apple.calendars.AudioAlarm
com.apple.calendars.Calendar
com.apple.calendars.DisplayAlarm
com.apple.calendars.Event
com.apple.calendars.Organizer
com.apple.calendars.Recurrence
com.apple.calendars.Task
com.apple.calendarU1.0.0XCalendarT????Z(SDK_NAME)TFMWK
com.apple.calendaruiZCalendarUIT????Z(SDK_NAME)TFMWK
com.apple.CameraU1.0.0VCameraT????Z(SDK_NAME)TFMWK
com.apple.capabilities
com.apple.CARenderServer
com.apple.carrier
com.apple.celestial
com.apple.Celestial
com.apple.CelestialYCelestialT????Z(SDK_NAME)TFMWK
com.apple.CFHTTPCookiesChanged
com.apple.CFNetwork
com.apple.CFNetworkYCFNetworkT????Z(SDK_NAME)TFMWK
com.apple.CFPreferences
com.apple.CFPreferences._didChange
com.apple.commcenter
com.apple.CommCenter
com.apple.commcenter.InternationalRoamingEDGE.changed
com.apple.CommCenter:_SetPacketContextActive
com.apple.CommCenter:copyServiceIDForUnit
com.apple.CommCenter:notifySystemConfigOfSettings
com.apple.CommCenter:offline
com.apple.CommCenter:setInterfaceAvailability
com.apple.CommCenter:writeServiceEntryToSystemConfig
com.apple.console
com.apple.Contacts
com.apple.contacts.Contact
com.apple.contacts.Date
com.apple.contacts.Email Address
com.apple.contacts.Group
com.apple.contacts.IM
com.apple.contacts.Phone Number
com.apple.contacts.Related Name
com.apple.contacts.Street Address
com.apple.contacts.URL
com.apple.coreaudio
com.apple.coreaudio-format
com.apple.CoreData
com.apple.CoreFoundation
com.apple.CoreFoundationU6.5.2^CoreFoundation
com.apple.coregraphics
com.apple.CoreGraphics
com.apple.corelocation/CoreLocationT????Z(SDK_NAME)TFMWK
com.apple.coremedia
com.apple.coremedia.rpctimeout
com.apple.CoreMediaU0.273YCoreMediaT????Z(SDK_NAME)TFMWK
com.apple.CoreSurfaceZ(SDK_NAME)T????TFMWK[CoreSurface
com.apple.coretelephonyS113]CoreTelephonyT????Z(SDK_NAME)TFMWK
com.apple.CrashReporter
com.apple.CrashReporterSupportV10.5.0_
com.apple.dashboard.client
com.apple.Dashcode
com.apple.dataaccess
com.apple.DataAccess
com.apple.dataaccess.dataaccessd
com.apple.dataaccess.dataaccessd.shutdown
com.apple.dataaccess.frameworkZDataAccessT????Z(SDK_NAME)TFMWK
com.apple.DataAccess.HostsToTrust
com.apple.DataAccess:ASTaskManager
com.apple.datamigration.reply
com.apple.datamigration]DataMigrationZ(SDK_NAME)T????TFMWK
com.apple.datamigrator.dz
com.apple.defaults.managed
com.apple.demo-settings
com.apple.DeviceLink
com.apple.DeviceLink.%@.%@
com.apple.DeviceLinkS1.0_
com.apple.Dictionary
com.apple.distributed_notifications.2
com.apple.DVCPROHDAudio
com.apple.dvdstudiopro
com.apple.eas.account
com.apple.eventpump
com.apple.fieldtest
com.apple.fig.movie
com.apple.fig.ThreadCreateKey_StackSize
com.apple.fig.ThreadPropKey_Priority
com.apple.FigCFHTTP-%ld-%0p
com.apple.FigHTTP-%ld
com.apple.FigHTTP-%ld-0x%08x
com.apple.FinderInfo
com.apple.Foundation.NSHTTPCookieManagerAcceptPolicyChanged
com.apple.FoundationU6.5.2ZFoundationT????Z(SDK_NAME)TFMWK
com.apple.framework.Apple80211S5.1ZApple80211Z(SDK_NAME)WEnglishXiphoneosS6.0_
com.apple.framework.calculateU1.3.0YCalculateT????Z(SDK_NAME)TFMWK
com.apple.framework.IOKitU1.5.1UIOKitT????Z(SDK_NAME)TFMWK_
com.apple.GraphicsServices_
com.apple.helpviewer
com.apple.IAP
com.apple.iapd
com.apple.iapd.acc-connected
com.apple.iapd.accessoryid
com.apple.iapd.audiostate.changed
com.apple.iapd.deviceid
com.apple.iapd.playbackstatechanged
com.apple.iapd.videoout.SettingsChanged
com.apple.ical.managed
com.apple.iChat
com.apple.icns
com.apple.iDVD
com.apple.ImageIO.framework
com.apple.ImageIO.frameworkWImageIOZ(SDK_NAME)WEnglishXiphoneosS6.0_
com.apple.internetconnect
com.apple.iohideventsystem
com.apple.iokit.hid.displayStatus
com.apple.IOMobileFramebufferU1.0.0_
com.apple.iSightAudio
com.apple.ITSyncPU1.0.0VITSyncT????TFMWK
com.apple.ITSyncU1.0.0VITSyncT????Z(SDK_NAME)TFMWK
com.apple.iTunes
com.apple.itunes-mobdev.syncDidFinish
com.apple.itunes-mobdev.syncDidStart
com.apple.itunes-mobdev.syncFailedToStart
com.apple.itunes-mobdev.syncLockRequest
com.apple.itunes-mobdev.syncTerminatedAbnormally
com.apple.itunes-mobdev.syncWillStart
com.apple.itunes.lock_sync
com.apple.itunes.syncing
com.apple.iTunesStore.cached-accout-info
com.apple.iTunesStore.daemon
com.apple.iTunesStore.daemon.launched
com.apple.iTunesStore.disk-space-needed
com.apple.iTunesStore.download-operation
com.apple.iTunesStore.download-state
com.apple.iTunesStore.downloadInfo
com.apple.iTunesStore.media-file-size
com.apple.itunesstore[iTunesStoreT????Z(SDK_NAME)TFMWK
com.apple.itunesstored
com.apple.itunesstored.defaults-changed
com.apple.itunesstored.download-queue
com.apple.itunesstored.keychain
com.apple.itunesstored.purchase-manager
com.apple.itunesstored.startinterval
com.apple.iTunesStoreUI]iTunesStoreUIT????Z(SDK_NAME)TFMWK
com.apple.iwork.iWorkImport
com.apple.iwork.iWorkImport[iWorkImportT????Z(SDK_NAME)TFMWK
com.apple.iwork.keynote.key
com.apple.iwork.lasso.lasso
com.apple.iwork.numbers.numbers
com.apple.iwork.pages.pages
com.apple.JavaAppletPlugin
com.apple.JavaPluginCocoa
com.apple.JavaScriptCoreZ(SDK_NAME)TFMWK_
com.apple.kernel
com.apple.kernel.libkern
com.apple.KernelExtensionServer
com.apple.kext.info
com.apple.Keynote
com.apple.keynote.key
com.apple.kMWSPreferencesChangedNotification
com.apple.kMWSSyncBookmarksNotification
com.apple.kMWSSyncCalendarsNotification
com.apple.kMWSSyncContactsNotification
com.apple.kpi
com.apple.language.changed
com.apple.Libsystem.malloc
com.apple.locationd
com.apple.locationd.fromClient_%04d.%d
com.apple.locationd.registration
com.apple.locationd.toClient_%04d.%d
com.apple.locationd/kClientConfirmedCount
com.apple.locationd/Prefs
com.apple.macpaint-image
com.apple.macpaint-image_
com.apple.mail
com.apple.mail._NSSocket
com.apple.mail.MailAccountsChanged
com.apple.mail.managed
com.apple.mail.MessageWebLayer
com.apple.Mail.ToDo
com.apple.MailAccounts
com.apple.managedCarrier
com.apple.ManagedConfiguration
com.apple.ManagedConfiguration.newParentalControls
com.apple.managedconfiguration.newPasscodeSet
com.apple.ManagedConfiguration.restoreComplete
com.apple.ManagedConfiguration_
com.apple.MapKit
com.apple.MapKitVMapKitT????Z(SDK_NAME)TFMWK
com.apple.MBX2DUMBX2DT????Z(SDK_NAME)TFMWK
com.apple.MBXConnectZMBXConnectT????Z(SDK_NAME)TFMWK
com.apple.MCX
com.apple.MCX._managementStatusChangedForDomains
com.apple.MCX.preferencesChanged
com.apple.mDNSResponder
com.apple.MediaPlayer[MediaPlayerT????Z(SDK_NAME)TFMWK
com.apple.mediaserverd
com.apple.MediaToolbox
com.apple.MediaToolboxU0.273/MediaToolboxT????Z(SDK_NAME)TFMWK
com.apple.Message
com.apple.message.fetchMobileSynchronously
com.apple.message.yahoo-%@
com.apple.MessageS2.0WMessageT????Z(SDK_NAME)TFMWK
com.apple.messageui.deliverMessage
com.apple.messageuiYMessageUIT????Z(SDK_NAME)TFMWK
com.apple.MessageUtilitiesS2.0_
com.apple.mobile.application_installed
com.apple.mobile.application_uninstalled
com.apple.mobile.data_sync
com.apple.mobile.installation.archive.plist
com.apple.mobile.installation.attributes.plist
com.apple.mobile.installation.composite_trust.plist
com.apple.mobile.installation.explicit_trust.plist
com.apple.mobile.installation.plist
com.apple.mobile.iTunes
com.apple.mobile.iTunes.store
com.apple.mobile.radio
com.apple.mobile.radio_
com.apple.mobile.SubstantialTransition
com.apple.mobile.sync_data_class
com.apple.mobile.sync_data_class value: %@
com.apple.MobileAddressBook
com.apple.mobilecal
com.apple.mobilecal.alarmengine
com.apple.mobilecal.invitationalertschanged
com.apple.mobilecal.timezonechanged
com.apple.mobiledevice.managed
com.apple.mobiledevice.passwordpolicy
com.apple.MobileInstallation_
com.apple.springboard.lockcomplete
com.apple.springboard.lowPowerAlertPresented com.apple.SpringBoard.mediaHUDDisabled 
com.apple.springboard.migserver 
com.apple.springboard.orientation
com.apple.springboard.plist
com.apple.springboard.pluggedin
com.apple.springboard.ring-vibrate.changed com.apple.springboard.ringerstate 
com.apple.springboard.showingAlertItem 
com.apple.springboard.silent-vibrate.changed 
com.apple.springboard.sound-effects-headphones.changed com.apple.springboard.sound-effects-speaker.changed com.apple.springboard.syncingUnblocked com.apple.springboard.unambiguousOrientation 
com.apple.springboard.vpn-changed 
com.apple.SpringBoardServices_ com.apple.SymbolicationS1.0]SymbolicationT????Z(SDK_NAME)TFMWK com.apple.SyncAgent.cancel 
com.apple.SyncAgent.disable com.apple.SyncAgent.MWSRequestFailureNotification com.apple.SyncAgent.MWSRequestSuccessNotification com.apple.SyncAgent.trigger 
com.apple.SyncServices.iPodSync
com.apple.syncservices.RecordEntityName 
com.apple.syncservices:
com.apple.system.config.network_change com.apple.system.DirectoryService.libinfo_v1 
com.apple.system.lastlog 
com.apple.system.logger
com.apple.system.memorystatus 
com.apple.system.notification_center 
com.apple.system.power.CPU
com.apple.system.power.thermal_warning 
com.apple.system.syslog
com.apple.system.syslog.master com.apple.system.SystemConfiguration.dns_configuration com.apple.system.thermalstatus
com.apple.system.timezone
com.apple.system.utmpx
com.apple.SystemConfiguration
com.apple.SystemConfiguration.configd com.apple.SystemConfiguration.PPPController
com.apple.SystemConfiguration_
com.apple.SystemPowerProfileDefaults.plist
com.apple.systemsound.plist
com.apple.TelephonyUI[TelephonyUIT????Z(SDK_NAME)TFMWK com.apple.TextEncoding 
com.apple.UIHierarchyDump.finished 
com.apple.UIKit
com.apple.uikit.uifieldeditor 
com.apple.UIKitUUIKitT????Z(SDK_NAME)TFMWK
com.apple.UIScreenDump.finished 
com.apple.universalaccess
com.apple.URLifyVURLifyZ(SDK_NAME)T????TFMWK com.apple.VideoToolboxU0.273/VideoToolboxT????Z(SDK_NAME)TFMWK com.apple.visualvoicemail_ 
com.apple.voicemail
com.apple.voicemail.acdsTACDSZ(SDK_NAME)[ACDSServiceWEnglishXiphoneosS6.0_ com.apple.voicemail.changed 
com.apple.voicemail.fallback
com.apple.voicemail.imap 
com.apple.voicemail.imap.parameters.plist com.apple.voicemail.imapTIMAPZ(SDK_NAME)[IMAPServiceWEnglishXiphoneosS6.0_ com.apple.voicemail.subscribed 
com.apple.vpn.managed 
com.apple.WebCore
com.apple.WebCoreWWebCoreZ(SDK_NAME)TFMWK 
com.apple.WebFoundation
com.apple.WebFoundation.ProxySettings.%ld 
com.apple.WebKit
com.apple.webkit.webmarkup 
com.apple.WebKitZ(SDK_NAME)TFMWK_
com.apple.wifi.aeropuerto 
com.apple.wifi.managed 
com.apple.wifi.plist com.apple.Xcode 
com.apple.youtube 
com_apple_mail_added


Discussion