Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not know initialize Success or Failure #120

Open
vienvuyum opened this issue Nov 30, 2023 · 1 comment
Open

Can not know initialize Success or Failure #120

vienvuyum opened this issue Nov 30, 2023 · 1 comment

Comments

@vienvuyum
Copy link

Hello!

I recently integrate SDK and I'm using v1.0.1 and ran into the "missing parameter:" error response when i upload event

I read SDK document

env
Xcode: 14.3.1
iOS: 16.4 simulator - iPhone 14 plus
Treasure Data SDK version: 1.0.1

error
error. errorCode= server_response, message= Optional("Response code was NOT 200. It was: 400")

reproduce steps
I just integrate code

TreasureData.enableLogging()
        TreasureData.initializeEncryptionKey("hello world")
        TreasureData.initialize(withApiKey: apiKey, apiEndpoint: endpoint)
        TreasureData.sharedInstance().defaultDatabase = "testdb"
        TreasureData.sharedInstance().enableAutoAppendUniqId()
        TreasureData.sharedInstance().enableAutoAppendModelInformation()
        TreasureData.sharedInstance().disableRetryUploading()
        TreasureData.sharedInstance().startSession("demotbl")
        TreasureData.sharedInstance().enableAppLifecycleEvent()

it dont let me know i .initialize success or not.

and when i up load event like this

 debugPrint("===== [Analytic] Treasure analytics upload event =====")
        TreasureData.sharedInstance().endSession("demotbl")
        let application = UIApplication.shared
        var bgTask : UIBackgroundTaskIdentifier = UIBackgroundTaskIdentifier(rawValue: 0)
        bgTask = application.beginBackgroundTask(expirationHandler: {
            application.endBackgroundTask(bgTask)
            bgTask = UIBackgroundTaskIdentifier.invalid
        })
        TreasureData.sharedInstance().uploadEvents(callback: {
            application.endBackgroundTask(bgTask)
            bgTask = UIBackgroundTaskIdentifier.invalid
            debugPrint("===== [Analytic] Treasure analytics upload event success =====")
        },
                                onError: {(errorCode, message) -> Void in
            print("===== [Analytic] Treasure analytics upload events: error. errorCode= \(errorCode), message= \(message)")
            application.endBackgroundTask(bgTask)
            bgTask = UIBackgroundTaskIdentifier.invalid
        })

I meet error error. errorCode= server_response, message= Optional("Response code was NOT 200. It was: 400")
Screenshot 2023-11-30 at 17 53 52

Note: Currently I just have endpoint and api key. So I can't access to dashboard to check other info

Thank you for your support😄

@tung-vu-td
Copy link
Contributor

@vienvuyum Please make sure you're using correct endpoint. For tokyo region it is https://ap01.records.in.treasuredata.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants