heremaps / here-ios-sdk-examples

Objective-C and Swift projects using the HERE SDK for iOS.
MIT License
60 stars 56 forks source link

Only one voice package id 206 #165

Closed cfw011566 closed 4 years ago

cfw011566 commented 4 years ago

Hi, I am using voiceCatalog to download different voice for navigation but got only one voice package whose id 206. I have print the count of voice packages and dumped the voice data in below:

voicePackages count = 1 <NMAVoicePackage: 0x2804f6c80; packageId = 206; name = "English (US)"; gender = 2; language = "English (US)"; languageCode = "en-US"; localizedLanguage = "English (US)"; isUpdateAvailable = 0; isInstalled = 1; downloadSize = -1.000; installationSize = 0.371; isRemovable = 0; quality = "(null)"; localizedGender = "(null)"; localizedQuality = "(null)"; localizedType = "(null)"; marcCode = "010"; version = "0.5.0.4043695813"; customAttributes = "(null)"; description = "English (US)">

Any hint? or suggestion?

dashchak commented 4 years ago

Hi @cfw011566 Please make sure you have followed all voice instructions If problem still exist, please provide sample code and specify HERE SDK version you use.

cfw011566 commented 4 years ago

I dump the voice at delegate function -voiceCatalog:didUpdateWithError:

sample code like following

extension MenuVoiceOptionViewController: NMAVoiceCatalogDelegate {    
func voiceCatalog(_ voiceCatalog: NMAVoiceCatalog, didUpdate error: Error?) {
        print("Did update \(error)")
        let version = NMAApplicationContext.sdkVersion()
        print("HERE SDK \(version)")
        print("count = \(voiceCatalog.voicePackages.count)")
        for (index, voice) in voiceCatalog.voicePackages.enumerated() {
            print("\(index) -------")
            print(voice)
        }
        LoadingIndicatorView.hide()
        self.fetchVoicePackageInfo()
        self.voiceTable.reloadData()
    }
}

dump from Xcode

Did update Optional(Error Domain=NMAVoiceCatalog Code=1 "(null)") HERE SDK 3.15.2.92 count = 1 0 ------- <NMAVoicePackage: 0x283b83720; packageId = 206; name = "English (US)"; gender = 2; language = "English (US)"; languageCode = "en-US"; localizedLanguage = "English (US)"; isUpdateAvailable = 0; isInstalled = 1; downloadSize = -1.000; installationSize = 0.371; isRemovable = 0; quality = "(null)"; localizedGender = "(null)"; localizedQuality = "(null)"; localizedType = "(null)"; marcCode = "010"; version = "0.5.0.4043695813"; customAttributes = "(null)"; description = "English (US)">

dashchak commented 4 years ago

Error with Code=1 (NMAVoiceCatalogErrorUnknown) is also returned for network related errors such as no connectivity.

cfw011566 commented 4 years ago

Thanks for the fast response.

The same code on different project, i.e. different bundle ID, is fine and returns 81 voice packages.

Any hint or suggestion ?

dashchak commented 4 years ago

Credentials(App_Id, App_Code, and licenseKey) are unique to your application bundle identifier. More about credentials here. Make sure NMAApplicationContext.setAppId does not return any error and is called before updateVoiceCatalog.

cfw011566 commented 4 years ago

I do setAppId in AppDelegate.swift and return value is 0.

let status = NMAApplicationContext.setAppId(hereAppID, appCode: hereAppCode, licenseKey: hereLicenseKey)
print("setAppId return \(status.rawValue)")

output setAppId return 0

The other functions like getting route and navigation work fine. Only voiceCatalog not working.

cfw011566 commented 4 years ago

This issue was fixed by asking support team's help.

dashchak commented 4 years ago

What was the root cause of the issue if it is not a secret? In case other users run into the same one we would recommend this solution. Thanks!

cfw011566 commented 4 years ago

It was not coding issue. The support team say that the voice was not enabled for my AppID. They enabled it then problem was solved.