Account login - login_status remains false even after updating

1. Summary

Account login integration : login status showing ‘false’ even after updating in content launcher

App Name: FrndlyTv app

Bug Severity
Select one that applies

  • Impacts operation of app

3. Observed Behavior

~$ kepler exec vda shell journalctl --follow --since now | grep -E ‘ContentAppEndpoint.*RQ188_FRD.*login_status’

Jan 06 11:02:59.072315 firestick-0adfe85b6993723a local0.info kcs-lib[9455]: 319962373 INFO com.amazon.kcs.service: KCS amzn_kcs_ipc_common::storage::lmdb_store - cargo-project/common/src/storage/lmdb_store.rs(125) insert invoked. key com.tvapp.frndlytv, value ContentAppEndpoint: endpoint_id=517, partner_id=RQ188_FRD, package_component=com.tvapp.frndlytv.main, asin=, login_status=false

4. Expected Behavior

login_status to be true after updating

6. Environment

Please fill out the fields related to your bug below:

  • SDK Version: 0.20.3351

  • 7. Example Code Snippet / Screenshots /

    AccountLoginWrapper.ts (2.8 KB)

  • manifest.toml (8.0 KB)

    service.js:
    import { HeadlessEntryPointRegistry } from ‘@amznamzn/headless-task-manager’;

    import { AccountLoginWrapper, AccountLoginWrapperInstance } from ‘./screens/utils/AccountLoginWrapper’;

    HeadlessEntryPointRegistry.registerHeadlessEntryPoint(

    “com.tvapp.frndlytv.service::onStartService”,

    () => onStartService

    );

    HeadlessEntryPointRegistry.registerHeadlessEntryPoint(

    “com.tvapp.frndlytv.service::onStopService”,

    () => onStopService

    );

    HeadlessEntryPointRegistry.registerHeadlessEntryPoint2(

    ‘com.tvapp.frndlytv.interface.provider::onStartService’,

    () => (componentInstance) =>

    AccountLoginWrapperInstance.onStart(componentInstance)

    );

    HeadlessEntryPointRegistry.registerHeadlessEntryPoint2(

    ‘com.tvapp.frndlytv.interface.provider::onStopService’,

    () => () =>

    AccountLoginWrapperInstance.onStop()

    );

    app.tsx:

  • useEffect(() => {

    if (!componentInstance) return;

const factory = new ContentLauncherServerComponent();

const contentLauncherHandler: IContentLauncherHandler = {

async handleLaunchContent(

contentSearch: IContentSearch,

autoPlay: boolean,

_optionalFields: ILaunchContentOptionalFields,

    ): Promise<ILauncherResponse> {

console.log(‘Content_Launcher_Sample: handleLaunchContent invoked.’);

let amznId: string | undefined;

const searchParameters = contentSearch.getParameterList();

if (searchParameters.length > 0) {

for (let j = 0; j < searchParameters.length; j++) {

console.log(‘searchParameters’, searchParameters[0]);

const additionalInfoList = searchParameters[j].getExternalIdList();

for (let i = 0; i < additionalInfoList.length; i++) {

console.log(‘additionalInfoList[0]’, additionalInfoList[0]);

const searchName = additionalInfoList[i].getName();

const entityID = additionalInfoList[i].getValue();

if (searchName === ‘amzn_id’) {

amznId = entityID;

console.log(‘amznId’, amznId);

break;

            }

          }

if (amznId) break;

        }

      }

if (!amznId) {

console.log(‘Content Launcher: amzn_id not found’);

return factory

          .makeLauncherResponseBuilder()

          .contentLauncherStatus(ContentLauncherStatusType.URL_NOT_AVAILABLE)

          .build();

      }

if (autoPlay) {

console.log(“autoplay1:::::::::::::::::::::::::::::::::::::::”);

const navigateToPlayer = () => {

navigationRef.navigate(Screens.PLAYER_SCREEN as any, {

targetpath: amznId,

          });

        };

if (navigationRef.isReady()) {

navigateToPlayer();

        } else {

console.log(‘Navigation not ready, retrying…’);

setTimeout(navigateToPlayer, 500);

        }

      } else {

console.log(‘In-App Search:’, amznId);

// navigate to Details/Search

console.log(‘Quick Play:’, amznId);

const navigateToFolioPage = () => {

navigationRef.navigate(

Screens.MOVIEFOLIO as any,

            {

targetPath: amznId,

// isfromcard: false,

            } as any,

          );

        };

// Navigation might not be ready during cold start

if (navigationRef.isReady()) {

navigateToFolioPage();

        } else {

console.log(‘Navigation not ready, retrying…’);

setTimeout(navigateToFolioPage, 500);

        }

      }

return factory

        .makeLauncherResponseBuilder()

        .contentLauncherStatus(ContentLauncherStatusType.SUCCESS)

        .build();

    },

  };

const contentLauncherServer = factory.getOrMakeServer();

contentLauncherServer.setHandlerForComponent(

contentLauncherHandler,

componentInstance

  );

return () => {

// No cleanup required unless SDK adds unregister support

  };

}, \[componentInstance\]);

useEffect(() => {

AccountLoginWrapperInstance.onStart(componentInstance);

return () => {

AccountLoginWrapperInstance.onStop();

};

}, );

signin page:

await AsyncStorage.setItem(LOGIN_KEY, ‘true’);

await AccountLoginWrapperInstance.updateStatus(true); 

signout page:

showToast(‘Logged out successfully’);

await AsyncStorage.setItem(LOGIN_KEY, ‘true’);

Hi @vittalmaradi,

Thank you for the detailed bug report on the account login integration issue where login_status remains false even after updating.

I’ve reviewed your implementation and identified several potential issues. Could you please try the following fixes?

Critical Fix - Signout Logic Bug: There appears to be a bug in your signout logic where you’re setting the LOGIN_KEY to ‘true’ during signout:

// Current code (incorrect)
await AsyncStorage.setItem(LOGIN_KEY, 'true'); // This sets to true when signing out!

// Should be
await AsyncStorage.setItem(LOGIN_KEY, 'false');
await AccountLoginWrapperInstance.updateStatus(false);

Additional Fixes to Try:

1. Add Status Update Call After Login: Ensure you’re calling updateStatus(true) after successful authentication:

// After successful login
await AccountLoginWrapperInstance.updateStatus(true);

2. Verify Service Registration: Your service registration appears correct. Your account login service properly uses com.tvapp.frndlytv.interface.provider as declared in your manifest.toml, which matches the override_attribute_component configuration.

3. Validate Component Instance: Ensure your AccountLoginWrapper properly stores and validates the component instance before calling updateStatus().

Please let me know if these fixes resolve the issue.

Thanks for helping us improve the Vega platform.

Warm regards,
Aishwarya

Hi @amen , I have tried above inputs but still persisting, login_status = false showing

Hi @YuppTV,

Thank you for trying the previous suggestions. I’ve consulted with our engineering team, and we’ve identified the root cause of your issue.

Critical Issue Found:

There’s an error in your service.js implementation. The import statement is using an incorrect package name.

Required Code Changes:

1. Fix the import statement in service.js:

Your current code:

import { HeadlessEntryPointRegistry } from '@amznamzn/headless-task-manager';

Should be changed to:

import { HeadlessEntryPointRegistry } from '@amazon-devices/headless-task-manager';
import { onStartService, onStopService } from './src/AccountLoginWrapper';

2. Update the entry point registration:

Replace your current entry point registration with:

HeadlessEntryPointRegistry.registerHeadlessEntryPoint2(
  'com.tvapp.frndlytv.interface.provider::onStartService',
  () => onStartService
);

HeadlessEntryPointRegistry.registerHeadlessEntryPoint2(
  'com.tvapp.frndlytv.interface.provider::onStopService',
  () => onStopService
);

Note: Make sure to use your correct component name com.tvapp.frndlytv.interface.provider (as shown in your manifest.toml) instead of the sample component name.

Reference Documentation: https://developer.amazon.com/docs/vega/latest/content-launcher-account-login-integration-guide.html#step-8-implement-a-headless-service

Please try these changes and let me know if the login_status updates correctly.

Warm regards,
Aishwarya

Hi @amen
after updating service.js file with above changes , it is working now.
Thank you

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.