How to get Issue Id or Issuekey of a current Issues using Forge Custom UI

Am trying to get Issue Id or Issuekey of a current Issues using Forge Custom UI but it throws errors issueKey undefined

import Resolver from '@forge/resolver';
import api, { route } from "@forge/api";

import { useProductContext } from '@forge/ui';

const resolver = new Resolver();

resolver.define('issueFunction1', async (req) => {
    const {issueKey} = req.context.extensionContext;
    return issueKey;


});



resolver.define('issueFunction2', async (req) => {
    const { platformContext: { issueKey } } = useProductContext();
 return issueKey;

});

The useProductContext hook is only for UI Kit apps.

Custom UI apps can get context information using getContext on the Custom UI Bridge.