You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Set the defaults to disabled unless we find otherwise...
104
-
NSString *pushBadge = @"disabled";
105
-
NSString *pushAlert = @"disabled";
106
-
NSString *pushSound = @"disabled";
107
-
108
-
// Check what Registered Types are turned on. This is a bit tricky since if two are enabled, and one is off, it will return a number 2... not telling you which
109
-
// one is actually disabled. So we are literally checking to see if rnTypes matches what is turned on, instead of by number. The "tricky" part is that the
110
-
// single notification types will only match if they are the ONLY one enabled. Likewise, when we are checking for a pair of notifications, it will only be
111
-
// true if those two notifications are on. This is why the code is written this way
112
-
if(rntypes & UIRemoteNotificationTypeBadge){
113
-
pushBadge = @"enabled";
114
-
}
115
-
if(rntypes & UIRemoteNotificationTypeAlert) {
116
-
pushAlert = @"enabled";
117
-
}
118
-
if(rntypes & UIRemoteNotificationTypeSound) {
119
-
pushSound = @"enabled";
120
-
}
121
-
122
-
[results setValue:pushBadge forKey:@"pushBadge"];
123
-
[results setValue:pushAlert forKey:@"pushAlert"];
124
-
[results setValue:pushSound forKey:@"pushSound"];
125
-
126
-
// Get the users Device Model, Display Name, Token & Version Number
// Set the defaults to disabled unless we find otherwise...
155
-
NSString *pushBadge = @"disabled";
156
-
NSString *pushAlert = @"disabled";
157
-
NSString *pushSound = @"disabled";
158
-
159
-
// Check what Registered Types are turned on. This is a bit tricky since if two are enabled, and one is off, it will return a number 2... not telling you which
160
-
// one is actually disabled. So we are literally checking to see if rnTypes matches what is turned on, instead of by number. The "tricky" part is that the
161
-
// single notification types will only match if they are the ONLY one enabled. Likewise, when we are checking for a pair of notifications, it will only be
162
-
// true if those two notifications are on. This is why the code is written this way
163
-
if(rntypes & UIRemoteNotificationTypeBadge){
164
-
pushBadge = @"enabled";
165
-
}
166
-
if(rntypes & UIRemoteNotificationTypeAlert) {
167
-
pushAlert = @"enabled";
168
-
}
169
-
if(rntypes & UIRemoteNotificationTypeSound) {
170
-
pushSound = @"enabled";
171
-
}
172
-
173
-
[results setValue:pushBadge forKey:@"pushBadge"];
174
-
[results setValue:pushAlert forKey:@"pushAlert"];
175
-
[results setValue:pushSound forKey:@"pushSound"];
176
-
177
-
// Get the users Device Model, Display Name, Token & Version Number
0 commit comments