title: Get device token if user refuse Push notification ios
body: <p>I have set Push notification into my new app. I have heard it is not a good way to do but I get the device token using: </p>
  
  <pre><code>- (void)application:(UIApplication *)application
  didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)newDeviceToken
  {
  
  
      NSString *deviceToken = [[newDeviceToken description] stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"&lt;&gt;"]];
      deviceToken = [deviceToken stringByReplacingOccurrencesOfString:@" " withString:@""];
  
      NSLog(@"###### DEVICE TOKEN = %@ #########",deviceToken); 
  
  
  }
  </code></pre>
  
  <p>Everything is okay for me, nevertheless I use this token to log in a user into my base, but I have a problem: how can I get the device token if the user refuses to receive push notifications? How can I get the device token outside the App Delegate? </p>