# Bug: 'Restore In-App Purchases' Blueprint node doesn't fire delegates if cancel is pressed for iTunes login on iOS

**URL:** <https://forums.unrealengine.com/t/bug-restore-in-app-purchases-blueprint-node-doesnt-fire-delegates-if-cancel-is-pressed-for-itunes-login-on-ios/343450>\
**Category:** Blueprint\
**Tags:** in-app-purchase, unreal-engine, iOS, bug-report, Blueprint, question\
**Created:** [January 8, 2016, 7:25am UTC](https://forums.unrealengine.com/t/bug-restore-in-app-purchases-blueprint-node-doesnt-fire-delegates-if-cancel-is-pressed-for-itunes-login-on-ios/343450 "2016-01-08T07:25:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![FacePalm.exe](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/facepalm.exe/32/943016_2.png) [@FacePalm.exe](https://forums.unrealengine.com/u/FacePalm.exe)\
**Post date:** [January 8, 2016, 7:25am UTC](https://forums.unrealengine.com/t/bug-restore-in-app-purchases-blueprint-node-doesnt-fire-delegates-if-cancel-is-pressed-for-itunes-login-on-ios/343450/1 "2016-01-08T07:25:37Z")

</div>

Hey guys,

This is very similar to the question I posted [HERE](https://answers.unrealengine.com/questions/357026/bug-read-in-app-purchase-information-blueprint-nod.html).

In this case however, the delegates don’t fire if cancel is pressed when the user is prompted for their iTunes password rather than a lack of connectivity.

The same solution as the other question doesn’t work however. (At least on iOS 8.1.1)

I have added the following block of code to the request:didFailWithError: delegate function implemented in the other question to catch any other errors however:

```
	else if ([Request isKindOfClass : [SKReceiptRefreshRequest class]])
	{
		// Direct the response back to the store interface
		[FIOSAsyncTask CreateTaskWithBlock : ^ bool(void)
		{
			IOnlineSubsystem* OnlineSub = IOnlineSubsystem::Get(FName(TEXT("IOS")));
			FOnlineStoreInterfaceIOS* StoreInterface = (FOnlineStoreInterfaceIOS*)OnlineSub->GetStoreInterface().Get();

			StoreInterface->TriggerOnInAppPurchaseRestoreCompleteDelegates( EInAppPurchaseState::Failed );
			return true;
		}];
	}

```

Let me know if you need any further info.

Cheers.

EDIT: So this solution does actually work. I’m not sure what I was doing incorrectly beforehand… Oh well.

---

<div class="post-metadata">

**Author:** ![Sean\_Flint](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sean\_Flint](https://forums.unrealengine.com/u/Sean_Flint)\
**Post date:** [January 13, 2016, 8:49pm UTC](https://forums.unrealengine.com/t/bug-restore-in-app-purchases-blueprint-node-doesnt-fire-delegates-if-cancel-is-pressed-for-itunes-login-on-ios/343450/2 "2016-01-13T20:49:28Z")

</div>

Hello,

According to your edit, it looks like you solved your issue, is that correct? If so, has this also resolved the issue on your other post that you provided a link to?

---

<div class="post-metadata">

**Author:** ![FacePalm.exe](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/facepalm.exe/32/943016_2.png) [@FacePalm.exe](https://forums.unrealengine.com/u/FacePalm.exe)\
**Post date:** [January 13, 2016, 10:37pm UTC](https://forums.unrealengine.com/t/bug-restore-in-app-purchases-blueprint-node-doesnt-fire-delegates-if-cancel-is-pressed-for-itunes-login-on-ios/343450/3 "2016-01-13T22:37:44Z")

</div>

The solution was what i posted in that other post, (i.e. implementing the request:didFailWithError: delegate function) and then adding the code I specified in the above question.

---

<div class="post-metadata">

**Author:** ![Sean\_Flint](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sean\_Flint](https://forums.unrealengine.com/u/Sean_Flint)\
**Post date:** [January 14, 2016, 1:03pm UTC](https://forums.unrealengine.com/t/bug-restore-in-app-purchases-blueprint-node-doesnt-fire-delegates-if-cancel-is-pressed-for-itunes-login-on-ios/343450/4 "2016-01-14T13:03:36Z")

</div>

I am marking this post as resolved, as you were able to discover a fix by implementing the code above in combination with the solution provided in this post: [BUG: 'Read In App Purchase Information' blueprint node never fires delegates if connection fails on iOS - Blueprint - Unreal Engine Forums](https://answers.unrealengine.com/questions/357026/bug-read-in-app-purchase-information-blueprint-nod.html)

Have a great day
