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’);