objective-c - nomore UDID - 如何存储每个设备的推送通知设置?
<p><div>
<aside class="s-notice s-notice__info post-notice js-post-notice mb16"role="status">
<div class="d-flex fd-column fw-nowrap">
<div class="d-flex fw-nowrap">
<div class="flex--item wmn0 fl1 lh-lg">
<div class="flex--item fl1 lh-lg">
<b>已结束。</b>此问题不符合 <a href="https://stackoverflow.com/help/closed-questions" rel="noreferrer noopener nofollow">Stack Overflow guidelines</a> .它目前不接受答案。
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>像这样:</p>
<pre><code>@interface UIDevice (UIDeviceAppIdentifier)
@property (readonly) NSString *deviceApplicationIdentifier;
@end
@implementation UIDevice (UIDeviceAppIdentifier)
- (NSString *) deviceApplicationIdentifier
{
static NSString *name = @"a string identifying your application, like its name";
NSUserDefaults*defaults = ;
NSString *value = ;
if (!value)
{
value = (NSString *) CFUUIDCreateString (NULL, CFUUIDCreate(NULL));
;
; // handle error
}
return value;
}
@end
</code></pre>
<p>iOS 文档或多或少描述了使用 CFUUIDCreate() 创建标识符并建议使用 UserDefaults 来存储它。</p></p>
<p style="font-size: 20px;">关于objective-c - nomore UDID - 如何存储每个设备的推送通知设置?,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/10037089/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/10037089/
</a>
</p>
页:
[1]