warning: [deprecation] FLAG_FULLSCREEN in LayoutParams has been deprecated - deprecated

E:\ShayariApp\app\src\main\java\com\shivamdhakad1366\shayari\adapters\WallpapersAdapter.java:252: warning: [deprecation] ACTION_MEDIA_SCANNER_SCAN_FILE in Intent has been deprecated
Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
^
E:\ShayariApp\app\src\main\java\com\shivamdhakad1366\shayari\IntroSlider\IntroActivity.java:44: warning: [deprecation] FLAG_FULLSCREEN in LayoutParams has been deprecated
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
^
E:\ShayariApp\app\src\main\java\com\shivamdhakad1366\shayari\IntroSlider\IntroActivity.java:45: warning: [deprecation] FLAG_FULLSCREEN in LayoutParams has been deprecated
WindowManager.LayoutParams.FLAG_FULLSCREEN);
^
E:\ShayariApp\app\src\main\java\com\shivamdhakad1366\shayari\IntroSlider\IntroActivity.java:116: warning: [deprecation] BaseOnTabSelectedListener in TabLayout has been deprecated
tabIndicator.addOnTabSelectedListener(new TabLayout.BaseOnTabSelectedListener() {
^
E:\ShayariApp\app\src\main\java\com\shivamdhakad1366\shayari\IntroSlider\IntroActivity.java:116: warning: [deprecation] addOnTabSelectedListener(BaseOnTabSelectedListener) in TabLayout has been deprecated
tabIndicator.addOnTabSelectedListener(new TabLayout.BaseOnTabSelectedListener() {
^
E:\ShayariApp\app\src\main\java\com\shivamdhakad1366\shayari\MainActivity.java:130: warning: [deprecation] withActivity(Activity) in Dexter has been deprecated
Dexter.withActivity(this)
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDao_Impl.java:61: warning: [deprecation] beginTransaction() in RoomDatabase has been deprecated
__db.beginTransaction();
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDao_Impl.java:64: warning: [deprecation] setTransactionSuccessful() in RoomDatabase has been deprecated
__db.setTransactionSuccessful();
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDao_Impl.java:66: warning: [deprecation] endTransaction() in RoomDatabase has been deprecated
__db.endTransaction();
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDao_Impl.java:72: warning: [deprecation] beginTransaction() in RoomDatabase has been deprecated
__db.beginTransaction();
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDao_Impl.java:75: warning: [deprecation] setTransactionSuccessful() in RoomDatabase has been deprecated
__db.setTransactionSuccessful();
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDao_Impl.java:77: warning: [deprecation] endTransaction() in RoomDatabase has been deprecated
__db.endTransaction();
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDatabase_Impl.java:43: warning: [deprecation] mCallbacks in RoomDatabase has been deprecated
if (mCallbacks != null) {
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDatabase_Impl.java:44: warning: [deprecation] mCallbacks in RoomDatabase has been deprecated
for (int _i = 0, _size = mCallbacks.size(); _i < _size; _i++) {
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDatabase_Impl.java:45: warning: [deprecation] mCallbacks in RoomDatabase has been deprecated
mCallbacks.get(_i).onCreate(_db);
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDatabase_Impl.java:52: warning: [deprecation] mDatabase in RoomDatabase has been deprecated
mDatabase = _db;
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDatabase_Impl.java:54: warning: [deprecation] mCallbacks in RoomDatabase has been deprecated
if (mCallbacks != null) {
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDatabase_Impl.java:55: warning: [deprecation] mCallbacks in RoomDatabase has been deprecated
for (int _i = 0, _size = mCallbacks.size(); _i < _size; _i++) {
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDatabase_Impl.java:56: warning: [deprecation] mCallbacks in RoomDatabase has been deprecated
mCallbacks.get(_i).onOpen(_db);
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDatabase_Impl.java:62: warning: [deprecation] validateMigration(SupportSQLiteDatabase) in Delegate has been deprecated
protected void validateMigration(SupportSQLiteDatabase _db) {
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDatabase_Impl.java:64: warning: [deprecation] Column(String,String,boolean,int) in Column has been deprecated
_columnsFavoritelist.put("id", new TableInfo.Column("id", "INTEGER", true, 1));
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDatabase_Impl.java:65: warning: [deprecation] Column(String,String,boolean,int) in Column has been deprecated
_columnsFavoritelist.put("image", new TableInfo.Column("image", "TEXT", false, 0));
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDatabase_Impl.java:66: warning: [deprecation] Column(String,String,boolean,int) in Column has been deprecated
_columnsFavoritelist.put("prname", new TableInfo.Column("prname", "TEXT", false, 0));
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDatabase_Impl.java:96: warning: [deprecation] beginTransaction() in RoomDatabase has been deprecated
super.beginTransaction();
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDatabase_Impl.java:98: warning: [deprecation] setTransactionSuccessful() in RoomDatabase has been deprecated
super.setTransactionSuccessful();
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDatabase_Impl.java:100: warning: [deprecation] endTransaction() in RoomDatabase has been deprecated
super.endTransaction();
^
26 warnings
E:\ShayariApp\app\src\main\java\com\shivamdhakad1366\shayari\adapters\WallpapersAdapter.java:252: warning: [deprecation] ACTION_MEDIA_SCANNER_SCAN_FILE in Intent has been deprecated
Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
^
E:\ShayariApp\app\src\main\java\com\shivamdhakad1366\shayari\IntroSlider\IntroActivity.java:44: warning: [deprecation] FLAG_FULLSCREEN in LayoutParams has been deprecated
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
^
E:\ShayariApp\app\src\main\java\com\shivamdhakad1366\shayari\IntroSlider\IntroActivity.java:45: warning: [deprecation] FLAG_FULLSCREEN in LayoutParams has been deprecated
WindowManager.LayoutParams.FLAG_FULLSCREEN);
^
E:\ShayariApp\app\src\main\java\com\shivamdhakad1366\shayari\IntroSlider\IntroActivity.java:116: warning: [deprecation] BaseOnTabSelectedListener in TabLayout has been deprecated
tabIndicator.addOnTabSelectedListener(new TabLayout.BaseOnTabSelectedListener() {
^
E:\ShayariApp\app\src\main\java\com\shivamdhakad1366\shayari\IntroSlider\IntroActivity.java:116: warning: [deprecation] addOnTabSelectedListener(BaseOnTabSelectedListener) in TabLayout has been deprecated
tabIndicator.addOnTabSelectedListener(new TabLayout.BaseOnTabSelectedListener() {
^
E:\ShayariApp\app\src\main\java\com\shivamdhakad1366\shayari\MainActivity.java:130: warning: [deprecation] withActivity(Activity) in Dexter has been deprecated
Dexter.withActivity(this)
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDao_Impl.java:61: warning: [deprecation] beginTransaction() in RoomDatabase has been deprecated
__db.beginTransaction();
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDao_Impl.java:64: warning: [deprecation] setTransactionSuccessful() in RoomDatabase has been deprecated
__db.setTransactionSuccessful();
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDao_Impl.java:66: warning: [deprecation] endTransaction() in RoomDatabase has been deprecated
__db.endTransaction();
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDao_Impl.java:72: warning: [deprecation] beginTransaction() in RoomDatabase has been deprecated
__db.beginTransaction();
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDao_Impl.java:75: warning: [deprecation] setTransactionSuccessful() in RoomDatabase has been deprecated
__db.setTransactionSuccessful();
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDao_Impl.java:77: warning: [deprecation] endTransaction() in RoomDatabase has been deprecated
__db.endTransaction();
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDatabase_Impl.java:43: warning: [deprecation] mCallbacks in RoomDatabase has been deprecated
if (mCallbacks != null) {
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDatabase_Impl.java:44: warning: [deprecation] mCallbacks in RoomDatabase has been deprecated
for (int _i = 0, _size = mCallbacks.size(); _i < _size; _i++) {
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDatabase_Impl.java:45: warning: [deprecation] mCallbacks in RoomDatabase has been deprecated
mCallbacks.get(_i).onCreate(_db);
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDatabase_Impl.java:52: warning: [deprecation] mDatabase in RoomDatabase has been deprecated
mDatabase = _db;
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDatabase_Impl.java:54: warning: [deprecation] mCallbacks in RoomDatabase has been deprecated
if (mCallbacks != null) {
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDatabase_Impl.java:55: warning: [deprecation] mCallbacks in RoomDatabase has been deprecated
for (int _i = 0, _size = mCallbacks.size(); _i < _size; _i++) {
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDatabase_Impl.java:56: warning: [deprecation] mCallbacks in RoomDatabase has been deprecated
mCallbacks.get(_i).onOpen(_db);
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDatabase_Impl.java:62: warning: [deprecation] validateMigration(SupportSQLiteDatabase) in Delegate has been deprecated
protected void validateMigration(SupportSQLiteDatabase _db) {
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDatabase_Impl.java:64: warning: [deprecation] Column(String,String,boolean,int) in Column has been deprecated
_columnsFavoritelist.put("id", new TableInfo.Column("id", "INTEGER", true, 1));
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDatabase_Impl.java:65: warning: [deprecation] Column(String,String,boolean,int) in Column has been deprecated
_columnsFavoritelist.put("image", new TableInfo.Column("image", "TEXT", false, 0));
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDatabase_Impl.java:66: warning: [deprecation] Column(String,String,boolean,int) in Column has been deprecated
_columnsFavoritelist.put("prname", new TableInfo.Column("prname", "TEXT", false, 0));
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDatabase_Impl.java:96: warning: [deprecation] beginTransaction() in RoomDatabase has been deprecated
super.beginTransaction();
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDatabase_Impl.java:98: warning: [deprecation] setTransactionSuccessful() in RoomDatabase has been deprecated
super.setTransactionSuccessful();
^
E:\ShayariApp\app\build\generated\ap_generated_sources\debug\out\com\shivamdhakad1366\shayari\favorite\FavoriteDatabase_Impl.java:100: warning: [deprecation] endTransaction() in RoomDatabase has been deprecated
super.endTransaction();
^
26 warnings

Related

How to inject the Firebase messaging isHeadless prop into AppDelegate.mm file with react-native 0.69.1

System Information:
System:
OS: macOS 12.4
CPU: (8) arm64 Apple M1
Memory: 97.44 MB / 8.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.16.0 - /opt/homebrew/opt/node#16/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 8.11.0 - /opt/homebrew/opt/node#16/bin/npm
Watchman: 2022.07.04.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK: Not Found
IDEs:
Android Studio: 2020.3 AI-203.7717.56.2031.7583922
Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
Languages:
Java: 11.0.15 - /usr/bin/javac
npmPackages:
#react-native-community/cli: Not Found
react: 18.0.0 => 18.0.0
react-native: 0.69.1 => 0.69.1
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
Hello folks, I am working on a react-native 0.69.1 project that uses Firebase push-notification service. I confirm that I am successfully getting push notifications when the app is in the foreground, background and in a killed state. In order to correctly update my badge count when receiving a push notification outside the app, I need to add to index.js the firebase method setBackgroundMessageHandler and handle if the app was opened via isHeadless prop.
import {AppRegistry} from 'react-native';
import App from './src/App';
import {name as appName} from './app.json';
import messaging from '#react-native-firebase/messaging';
// Register background handler
messaging().setBackgroundMessageHandler(async remoteMessage => {
//Update badge count in here
});
function HeadlessCheck({isHeadless}) {
if (isHeadless) {
// App has been launched in the background by iOS, ignore
return null;
}
return App;
}
AppRegistry.registerComponent(appName, () => HeadlessCheck);
I am aware that the headless prop does not exist on iOS and needs to be injected into AppDelegate.m/AppDelegate.mm file. However firebase has not updated their documentation to inject the isHeadless prop into the AppDelegate.mm file created by react-native-0.69.1.
Below is the snipped of my AppDelegate.mm file where I have to inject the isHeadless prop in.
#import "AppDelegate.h"
#import "RNBootSplash.h"
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <React/RCTAppSetupUtils.h>
#import <UserNotifications/UserNotifications.h>
#import <RNCPushNotificationIOS.h>
#import <Firebase.h>
#import <TSBackgroundFetch/TSBackgroundFetch.h>
#if RCT_NEW_ARCH_ENABLED
#import <React/CoreModulesPlugins.h>
#import <React/RCTCxxBridgeDelegate.h>
#import <React/RCTFabricSurfaceHostingProxyRootView.h>
#import <React/RCTSurfacePresenter.h>
#import <React/RCTSurfacePresenterBridgeAdapter.h>
#import <ReactCommon/RCTTurboModuleManager.h>
#import <react/config/ReactNativeConfig.h>
static NSString *const kRNConcurrentRoot = #"concurrentRoot";
#interface AppDelegate () <RCTCxxBridgeDelegate, RCTTurboModuleManagerDelegate> {
RCTTurboModuleManager *_turboModuleManager;
RCTSurfacePresenterBridgeAdapter *_bridgeAdapter;
std::shared_ptr<const facebook::react::ReactNativeConfig> _reactNativeConfig;
facebook::react::ContextContainer::Shared _contextContainer;
}
#end
#endif
#implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[FIRApp configure];
RCTAppSetupPrepareApp(application);
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
#if RCT_NEW_ARCH_ENABLED
_contextContainer = std::make_shared<facebook::react::ContextContainer const>();
_reactNativeConfig = std::make_shared<facebook::react::EmptyReactNativeConfig const>();
_contextContainer->insert("ReactNativeConfig", _reactNativeConfig);
_bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer];
bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;
#endif
NSDictionary *initProps = [self prepareInitialProps];
UIView *rootView = RCTAppSetupDefaultRootView(bridge, #"amigo", initProps);
if (#available(iOS 13.0, *)) {
rootView.backgroundColor = [UIColor systemBackgroundColor];
} else {
rootView.backgroundColor = [UIColor whiteColor];
}
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [UIViewController new];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
// Define UNUserNotificationCenter
UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
center.delegate = self;
// [REQUIRED] Register BackgroundFetch
[[TSBackgroundFetch sharedInstance] didFinishLaunching];
[RNBootSplash initWithStoryboard:#"BootSplash" rootView:rootView];
return YES;
}
//Called when a notification is delivered to a foreground app.
-(void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler
{
completionHandler(UNNotificationPresentationOptionSound | UNNotificationPresentationOptionAlert | UNNotificationPresentationOptionBadge);
}
// Required for the register event.
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
[RNCPushNotificationIOS didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
}
// Required for the notification event. You must call the completion handler after handling the remote notification.
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
{
[RNCPushNotificationIOS didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
}
// Required for the registrationError event.
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
{
[RNCPushNotificationIOS didFailToRegisterForRemoteNotificationsWithError:error];
}
// Required for localNotification event
- (void)userNotificationCenter:(UNUserNotificationCenter *)center
didReceiveNotificationResponse:(UNNotificationResponse *)response
withCompletionHandler:(void (^)(void))completionHandler
{
[RNCPushNotificationIOS didReceiveNotificationResponse:response];
}
/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.
///
/// #see: https://reactjs.org/blog/2022/03/29/react-v18.html
/// #note: This requires to be rendering on Fabric (i.e. on the New Architecture).
/// #return: `true` if the `concurrentRoot` feture is enabled. Otherwise, it returns `false`.
- (BOOL)concurrentRootEnabled
{
// Switch this bool to turn on and off the concurrent root
return true;
}
- (NSDictionary *)prepareInitialProps
{
NSMutableDictionary *initProps = [NSMutableDictionary new];
#ifdef RCT_NEW_ARCH_ENABLED
initProps[kRNConcurrentRoot] = #([self concurrentRootEnabled]);
#endif
return initProps;
}
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:#"index"];
#else
return [[NSBundle mainBundle] URLForResource:#"main" withExtension:#"jsbundle"];
#endif
}
#if RCT_NEW_ARCH_ENABLED
#pragma mark - RCTCxxBridgeDelegate
- (std::unique_ptr<facebook::react::JSExecutorFactory>)jsExecutorFactoryForBridge:(RCTBridge *)bridge
{
_turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge
delegate:self
jsInvoker:bridge.jsCallInvoker];
return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager);
}
#pragma mark RCTTurboModuleManagerDelegate
- (Class)getModuleClassFromName:(const char *)name
{
return RCTCoreModulesClassProvider(name);
}
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
jsInvoker:(std::shared_ptr<facebook::react::CallInvoker>)jsInvoker
{
return nullptr;
}
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
initParams:
(const facebook::react::ObjCTurboModule::InitParams &)params
{
return nullptr;
}
- (id<RCTTurboModule>)getModuleInstanceFromClass:(Class)moduleClass
{
return RCTAppSetupDefaultModuleFromClass(moduleClass);
}
#endif
#end
RN Community , please help me out if you experience the same issue :)
You can change this
UIView *rootView = RCTAppSetupDefaultRootView(bridge, #"amigo", initProps);
to
NSDictionary *appProperties = [RNFBMessagingModule addCustomPropsToUserProps:nil withLaunchOptions:launchOptions];
NSMutableDictionary *initialProps = [initProps mutableCopy];
[initialProps addEntriesFromDictionary:appProperties];
UIView *rootView = RCTAppSetupDefaultRootView(bridge, #"amigo", initialProps);

'CFURLCreateStringByAddingPercentEscapes' is deprecated: first deprecated in iOS 9.0 Use NSString stringByAddingPercentEncodingWithAllowedCharacters:

-(NSString*)urlEscapeString:(NSString *)unencodedString
{
CFStringRef originalStringRef = (__bridge_retained CFStringRef)unencodedString;
NSString *s = (__bridge_transfer NSString *)CFURLCreateStringByAddingPercentEscapes(NULL,originalStringRef, NULL, (CFStringRef)#"!*'\"();:#&=$,/?%#[]%", kCFStringEncodingUTF8);
CFRelease(originalStringRef);
return s;
}

Extract setting to top level val

Given:
resourceGenerators in Compile += Def.task {
val jar = (update in Compile).value
.matching((_: ModuleID) == nemesisProto)
.head
IO.unzip(jar, (resourceManaged in Compile).value / "protobuf").toSeq
}.taskValue
PB.protoSources in Compile := Seq((resourceManaged in Compile).value / "protobuf")
Is is possible to refactor (resourceManaged in Compile).value / "protobuf" to a common place?
I tried assigning it to a val:
val protobufResourceFile = (resourceManaged in Compile).value / "protobuf"
resourceGenerators in Compile += Def.task {
val jar = (update in Compile).value
.matching((_: ModuleID) == nemesisProto)
.head
IO.unzip(jar, protobufResourceFile).toSeq
}.taskValue
PB.protoSources in Compile := Seq(protobufResourceFile)
Only to get the following error:
error: `value` can only be used within a task or setting macro, such as :=, +=, ++=, Def.task, or Def.setting.
val protobufResourceFolder = (resourceManaged in Compile).value / "protobuf"
^
Almost. As the error message states you simply cannot unwrap a value outside the sbt dsl. So, something like this is usually done using a SettingKey:
val protobufResourceFile = settingKey[File]("Protobuf resource file ...")
protobufResourceFile := (resourceManaged in Compile).value / "protobuf"
resourceGenerators in Compile += Def.task {
val jar = (update in Compile).value
.matching((_: ModuleID) == nemesisProto)
.head
IO.unzip(jar, protobufResourceFile.value).toSeq
}.taskValue
PB.protoSources in Compile := Seq(protobufResourceFile.value)
Though, in this specific case it may be overkill.

More detailed error from runbuf function in Dynamics AX

I try to build some kind of X++ script executor and therefore play around with the runbuf function.
It works as long as the X++ code I pass in is valid, but when I pass invalid code then it just throws an error that it is not able to compile the code but no further details.
For example when I try the following code
runbuf('void dynAdd(int lhs, int rhs) { return lhs + rhs; }');
it fails with the error
Unable to compile "void dynAdd(int lhs, int rhs) { return lhs + rhs;
}".
Is there a way to get more information about the error?
Thanks in advance
You can use XppCompiler for that like so
static void DynamicXppTest(Args _args)
{
str dynamicXpp;
int result;
XppCompiler xppCompiler;
;
dynamicXpp = 'void dynAdd(int lhs, int rhs) { return lhs + rhs; }';
// previous runbuf - style
//
// result = runbuf(dynamicXpp, 3, 4);
// info(strfmt("result = %1", result));
xppCompiler = new XppCompiler();
if (xppCompiler.compile(dynamicXpp))
{
result = xppCompiler.execute(3, 4);
info(strfmt("result = %1", result));
}
else
{
error(xppCompiler.errorText());
}
}
which will result in the below error in the infolog
*** Error: 82, The operand is not compatible with the type of the function.

Cannot put QAbstractListModel object as one class's property

My code looks like so:
class Wrapper: public QObject {
Q_OBJECT
Q_PROPERTY(PeopleListModel & list READ list)
public:
PeopleListModel & list() {
return list_;
}
private:
PeopleListModel list_;
};
And PeopleListModel is a subclass of QAbstractListModel.
But I got compilation error:
^
In file included from plugin.cpp:131:0:
plugin.moc: In member function ‘virtual int Wrapper::qt_metacall(QMetaObject::Call, int, void**)’:
plugin.moc:184:52: error: cannot declare pointer to ‘class PeopleListModel&’
case 0: *reinterpret_cast< PeopleListModel&*>(_v) = list(); break;
^
In file included from ../../../../Qt5.2.0/5.2.0/gcc_64/include/QtCore/qnamespace.h:45:0,
from ../../../../Qt5.2.0/5.2.0/gcc_64/include/QtCore/qobjectdefs.h:45,
from ../../../../Qt5.2.0/5.2.0/gcc_64/include/QtCore/qobject.h:48,
from ../../../../Qt5.2.0/5.2.0/gcc_64/include/QtCore/qplugin.h:45,
from ../../../../Qt5.2.0/5.2.0/gcc_64/include/QtQml/qqmlextensionplugin.h:45,
from ../../../../Qt5.2.0/5.2.0/gcc_64/include/QtQml/QQmlExtensionPlugin:1,
from plugin.cpp:1:
../../../../Qt5.2.0/5.2.0/gcc_64/include/QtCore/qabstractitemmodel.h: In member function ‘PeopleListModel& PeopleListModel::operator=(const PeopleListModel&)’:
../../../../Qt5.2.0/5.2.0/gcc_64/include/QtCore/qglobal.h:967:12: error: ‘QAbstractListModel& QAbstractListModel::operator=(const QAbstractListModel&)’ is private
Class &operator=(const Class &) Q_DECL_EQ_DELETE;
^
../../../../Qt5.2.0/5.2.0/gcc_64/include/QtCore/qabstractitemmodel.h:479:5: note: in expansion of macro ‘Q_DISABLE_COPY’
Q_DISABLE_COPY(QAbstractListModel)
^
plugin.cpp:32:7: error: within this context
class PeopleListModel : public QAbstractListModel {
^
In file included from plugin.cpp:131:0:
plugin.moc: In member function ‘virtual int Wrapper::qt_metacall(QMetaObject::Call, int, void**)’:
plugin.moc:184:59: note: synthesized method ‘PeopleListModel& PeopleListModel::operator=(const PeopleListModel&)’ first required here
case 0: *reinterpret_cast< PeopleListModel&*>(_v) = list(); break;
^
make: *** [plugin.o] Error 1

Resources