我知道每个人以前都可能遇到过这个问题,我认为这个问题可能相同,但是我期望的'uniq_identifier'应该是序列号,例如0、1、2、3 ...,但是我总是得到1永远。
enter code here
array.forEach(element => {
let categoryId = 'categoryId'
let body = 'Press and hold for more options,God bless USA!';
console.log(`completeID-${element}`);
var uniq_identifier = `completeID-${element}`;
Notifications.createCategoryAsync(uniq_identifier,[
{
actionId: uniq_identifier,buttonTitle: `USA ${element}`,isDestructive: false,isAuthenticationRequired: false,},{
actionId: 'God and me',buttonTitle: 'Delay',]).then(() => {
console.log('var in async: ',element);
});
});