azure-notificationhubs-ios icon indicating copy to clipboard operation
azure-notificationhubs-ios copied to clipboard

Build failure in Objective C++ projects [BUG]

Open diegomichell opened this issue 2 years ago • 10 comments
trafficstars

Describe the bug Some of the files like MSNotificationHub.m and MSNotificationHub.h use "template" as the name for properties which is a reserved keyword in Objective C++, this essentially prevents projects that use Objective C++ from calling this library and this also affects React Native users as the latest version of the framework uses Objective C++ for the AppDelegate.mm

Exception or Stack Trace Expected identifier; 'template' is a keyword in Objective-C++

To Reproduce Reference the library in .mm files.

Code Snippet + (BOOL)setTemplate:(MSInstallationTemplate *)template forKey:(NSString *)key { return [sharedInstance setTemplate:template forKey:key]; }

this and other similar code where "template" keyword is used.

Expected behavior The project should compile without errors.

Setup (please complete the following information):

  • OS: 16.2
  • IDE : 14.2
  • Version of the Library used: 3.1.5

Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • [x] Bug Description Added
  • [X] Repro Steps Added
  • [X] Setup information Added

diegomichell avatar Jan 02 '23 13:01 diegomichell

Thanks for pointing this out! I have a PR that should resolve this. I'll get it merged once it passes the required checks.

brannon avatar Feb 07 '23 03:02 brannon

This should be fixed in #138

brannon avatar Feb 07 '23 17:02 brannon

This was fixed, though do you know when a new binary will be created and available for installation through cocoa pods that includes this change?

diegomichell avatar Mar 26 '23 01:03 diegomichell

hey, this issue still exists. even downloading the latest release source codes and still using template keyword instead of installationTemplate

mrzslr avatar Feb 12 '24 07:02 mrzslr

@marstr this issue was fixed a while back, but it requires a new release of the SDK.

I'll reopen the issue for now. We can close it once the fix is released.

brannon avatar Mar 07 '24 17:03 brannon

Acknowledged. Thanks for bringing this back to our attention, @brannon.

marstr avatar Mar 07 '24 21:03 marstr

Can we know when this fixed is released?

hieucm avatar Mar 25 '24 07:03 hieucm

Are there any plans for a release @marstr ?

Brqqq avatar Oct 10 '24 12:10 Brqqq

Howdy - I accepted a new role, and the team transitioned to new ownership in a different department. I'll see if I can get this thread some attention from the new owners. But I'm afraid I won't be of much more help than that.

marstr avatar Oct 10 '24 16:10 marstr

Any workaround for this issue?

wscld avatar Oct 29 '24 16:10 wscld