How do I update "Language" tag's value after registered once?

Answered

Comments

6 comments

  • Avatar
    Dmitry Dyudeev

    Hello,

    Actually, our SDK handles all three default Tags by itself, for instance, the Language Tag value is exactly the default language on the device.

    In case of custom Tags, you should simply send another setTags request, and the value would be updated.

  • Avatar
    mkftr

    Hi, Thank you for your answer. I understood we can not modify special tags (eg. Language) But, I think the "Language" tag should refer OS's user language and should not refer OS's user locale?

    It seems that the "Language" tag's value is loaded from

    [NSLocale currentLocale]

    But the value should be loaded like below?

    NSArray languages = [NSLocale preferredLanguages]; NSString lang = [languages objectAtIndex:0];

    Thank you.

  • Avatar
    Dmitry Dyudeev

    The SDK takes exactly the device's language as the Language Tag value. Here's the code from the SDK:

    NSArray * languagesArr = (NSArray *) CFBridgingRelease(CFLocaleCopyPreferredLanguages());   
    NSString * value = [languagesArr objectAtIndex:0];
    
  • Avatar
    mkftr

    Thank you for sharing the code. You're right, it seems correct.

    My main issue is that I can't update Language tag even changed preferred languages. For example, the request & response was like below, if I register my device with Language=ja and changed to "en" and called setTags.

    • setTags Request: {"request":{"tags":{"Language":"en"},"v":"2.2","hwid":"0DC5E1D8-AE28-4EAE-AA05-148C99A9397E"}}

    • loadTags Response: {"status_code":200,"status_message":"OK","response":{"result":{"Language":"ja","City":"jp, yokohama","Country":"JP"}}}

    So, is there any way to update the Language Tag value?

  • Avatar
    Dmitry Dyudeev

    You are most welcome!

    Please note that we update Language Tag value with the registerDevice request, as you can see in our guide.

    Each time the registerDevice method is called, our servers update the language statistics in your Control Panel. We have just tested it, and everything seems to work properly.

  • Avatar
    mkftr

    Finally I could update Language Tag with the registerDevice request. Thank you!

Please sign in to leave a comment.