# 800100 Error code when registering device token

**URL:** <https://community.sendbird.com/t/800100-error-code-when-registering-device-token/8684>\
**Category:** iOS\
**Created:** [December 4, 2023, 7:32pm UTC](https://community.sendbird.com/t/800100-error-code-when-registering-device-token/8684 "2023-12-04T19:32:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![williamwjs](https://avatars.discourse-cdn.com/v4/letter/w/eb9ed0/32.png) [@williamwjs](https://community.sendbird.com/u/williamwjs)\
**Post date:** [December 4, 2023, 7:32pm UTC](https://community.sendbird.com/t/800100-error-code-when-registering-device-token/8684/1 "2023-12-04T19:32:15Z")

</div>

**[Problem/Question]**  
// Detailed description of issue.  
Getting the below error when trying to register device token on iOS side:

Error Domain=chat Code=800100 “Initialization has not been done yet.” UserInfo={NSLocalizedDescription=Initialization has not been done yet.}

My code is:

```auto
    func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
        // Register a device token to Sendbird server.
        SendbirdChat.registerDevicePushToken(deviceToken, unique: true, completionHandler: { (status, error) in
            if error == nil {
                // A device token is successfully registered.
            }
            else {
                if status == .pending {
                    // A token registration is pending.
                }
                else {
                    // Handle registration failure.
                }
            }
        })
    }

```

The iOS app could use the send bird UIKit to send and receive messages. So I am thinking it is an ordering issue between the `SendbirdChat` initialization and registering device token. Could you help suggest how to make the initialization order correct?  
Thank you!

* * *

// If problem, please fill out the below. If question, please delete.  
**[UIKit Version]**  
// What version of the SDK are you using?  
3.9.3

**[Reproduction Steps]**  
// Please provide reproduction steps and, if possible, code snippets.

**[Frequency]**  
// How frequently is this issue occurring?  
Constantly in my local running

**[Current impact]**  
// How is this currently impacting your implementation?  
Cannot register device token

---

<div class="post-metadata">

**Author:** ![williamwjs](https://avatars.discourse-cdn.com/v4/letter/w/eb9ed0/32.png) [@williamwjs](https://community.sendbird.com/u/williamwjs)\
**Post date:** [December 5, 2023, 12:58am UTC](https://community.sendbird.com/t/800100-error-code-when-registering-device-token/8684/2 "2023-12-05T00:58:32Z")

</div>

Found the solution - Should put initialization in the AppDelegate as well
