Coder Social home page Coder Social logo

microsoft / appcenter-sdk-react-native Goto Github PK

View Code? Open in Web Editor NEW
408.0 32.0 135.0 215.37 MB

Development repository for the App Center SDK for React Native

License: Other

Ruby 2.83% JavaScript 47.08% Objective-C 15.89% Java 19.78% Shell 6.54% TypeScript 5.03% CMake 0.51% C++ 0.43% Starlark 1.89% C 0.03%
react-native javascript appcenter

appcenter-sdk-react-native's Introduction

NPM Version NPM Downloads license

Visual Studio App Center SDK for React Native

App Center is your continuous integration, delivery and learning solution for iOS and Android apps. Get faster release cycles, higher-quality apps, and the insights to build what users want.

The App Center SDK uses a modular architecture so you can use any or all of the following services:

  1. App Center Analytics: App Center Analytics helps you understand user behavior and customer engagement to improve your app. The SDK automatically captures session count, device properties like model, OS version, etc. You can define your own custom events to measure things that matter to you. All the information captured is available in the App Center portal for you to analyze the data.

  2. App Center Crashes: App Center Crashes will automatically generate a crash log every time your app crashes. The log is first written to the device's storage and when the user starts the app again, the crash report will be sent to App Center. Collecting crashes works for both beta and live apps, i.e. those submitted to the App Store. Crash logs contain valuable information for you to help fix the crash.

1. Get started

It is super easy to use App Center. Have a look at our get started documentation and onboard your app within minutes. Our detailed documentation is available as well.

2. Contributing

We are looking forward to your contributions via pull requests.

2.1 Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

2.2 Contributor License

You must sign a Contributor License Agreement before submitting your pull request. To complete the Contributor License Agreement (CLA), you will need to submit a request via the form and then electronically sign the CLA when you receive the email containing the link to the document. You need to sign the CLA only once to cover submission to any Microsoft OSS project.

3. Contact

3.1 Support

App Center SDK support is provided directly within the App Center portal. Any time you need help, just log in to App Center, then click the blue chat button in the lower-right corner of any page and our dedicated support team will respond to your questions and feedback. For additional information, see the App Center Help Center.

3.2 Twitter

We're on Twitter as @VSAppCenter.

appcenter-sdk-react-native's People

Contributors

achocron avatar anatolypristensky avatar bretjohnson avatar dhei avatar dmitriykirakosyan avatar dorothysun216 avatar dtrabo avatar geof90 avatar guperrot avatar jaeklim avatar janpieterz avatar jiaoqian-01 avatar matkovivan avatar mehrdadmzfr avatar micarls avatar mslaguana avatar nikitag-ms avatar nisteuve avatar owlstronaut avatar roland-chernov avatar steph-dove avatar thyeggman avatar tjyung avatar udayanalla avatar v-momoin avatar vvechkanov avatar yimysty avatar yoannchaudet avatar youngbupark avatar zhangcc01 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

appcenter-sdk-react-native's Issues

Technically feasible to depend only on NPM instead of CocoaPods?

This is more like a question (maybe feature request) so please feel free to close it, I apologise if this is not the right medium.

Is it technically feasible/possible to not rely on CocoaPods for the Mobile Center SDK? Instead could mobile-center-analytics and mobile-center-crashes only rely on the NPM package manager? If that would be possible it would provide an easier way to update published apps in the app store that use CodePush. For example, the other day there was an update from v0.1.5 to v0.2.2. Updating would then I assume require a resubmission to the Apple App store.

I imagine that there is a good reason why CocoaPods is required that I'm not seeing but wanted to bring it up just in case. Keep up the good work ๐Ÿ‘

Update: After thinking some more about this I think it wouldn't change anything in regards to CodePush. When native code (Obj-C) gets updated in libraries, one way or another a recompile is necessary meaning a resubmission would be required.

Analytics is undefined

Hi guys,

I'm getting the following error when I try to import the sdk: Analytics is undefined

react-native error

Thanks in advance, Nicholls

Support use without `react-native link`; add `.podspec` for libraries

I have a so-called "brownfield" app; a native iOS Swift app with integrated React Native views.

To do this I had to add all React libraries as CocoaPods dependencies. But now when I add mobile-center as npm dependency and run react-native link, it's added correctly, but the project doesn't build because the linked project can't find the React library files.

Up until now for all other libraries installed through npm, there was always a podspec file for the React Library too. So I just referred to the local podspec file in the node_modules directory, and didn't have to use react-native link.

So my question is; can there be podspecs added to the different libraries? Or would you accept a PR that does so?

iOS JS Warning: Sending '...' with no listeners

I keep getting the following warnings when trying to send crash reports, however the crash reports still get sent properly. During setup with "react-native link", I selected "Automatically" for when to send crash reports. We are not using any of these listeners in our project. Since the documentation says "All callbacks are optional.", it seems like these warnings should not be shown.

The two errors I get are:
Sending 'MobileCenterErrorReportOnBeforeSending' with no listeners registered.
screen shot 2017-11-20 at 1 22 32 pm

Sending 'MobileCenterErrorReportOnSendingSucceeded' with no listeners registered.
screen shot 2017-11-20 at 1 22 09 pm

add support for React Native Windows

We are shipping a desktop application using React Native Windows, and want to evaluate using Mobile Center. Is Mobile Center totally incompatible with Windows applications, or does someone just need to do the work to make it react-native-windows friendly? /cc @rozele

Analytics.trackEvent doesn't allow message with no props

Expected behaviour

Analytics.trackEvent("Log in successful."); should run without errors

Actual behaviour

Error:
undefined is not an object (evaluating 'Object.keys(props)')
in Analytics.js:26:16

Steps to reproduce

Possible solution

Add default props to equal null and add early break in Analytics.js:20:

function sanitizeProperties(props = null) {
    if(props === null) {
        return {};
    }
....

fatal error: module 'MobileCenterCrashes' not found @import MobileCenterCrashes

I'm getting a fatal error when trying to run my ios project with react-native run-ios

In file included from /Users/Admin/DemoApp/ios/DemoApp/AppDelegate.m:11: 
In file included from /Users/Admin/DemoApp/ios/build/Build/Products/Debug-iphonesimulator/include/RNCrashes/RNCrashes.h:3: 
/Users/Admin/DemoApp/ios/build/Build/Products/Debug-iphonesimulator/include/RNCrashes/RNCrashesDelegate.h:3:9: 
fatal error: module 'MobileCenterCrashes' not found @import MobileCenterCrashes;  ~~~~~~~^~~~~~~~~~~~~~~~~~~ 1 error generated.

[Feature request] Get Build Number

I want to be able to display the auto incremented build number seen in the email notification. It exposed in JS like how MobileCenter.getInstallId() is.

When trying to link the package 'react-native link mobile-center-analytics' it says `Error: Cannot find module './Podfile'`

When I try to link the package to the project I get the following error:

module.js:472
    throw err;
    ^

Error: Cannot find module './Podfile'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/pubudu/Projects/recruitx_mobile/node_modules/mobile-center-link-scripts/src/ios/index.js:14:15)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
/home/pubudu/Projects/recruitx_mobile/node_modules/react-native/local-cli/core/makeCommand.js:19
        throw new Error(`Error occured during executing "${ command }" command`);
        ^

Error: Error occured during executing "node node_modules/mobile-center-analytics/scripts/prelink" command
    at ChildProcess.prelink (/home/pubudu/Projects/recruitx_mobile/node_modules/react-native/local-cli/core/makeCommand.js:19:15)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:885:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

Any idea why?

mobile-center-analytics linking error

Trying to call react-native link mobile-center-analytics

Gives me a cocoapods error:

? For the iOS app, should user tracking be enabled automatically? Enable Automatically
Added code to initialize iOS Crashes SDK in ios/Upserve/AppDelegate.m
(node:51385) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error:
    Error: Could not find a "# Pods for" comment in your Podfile. Please add a "# Pods for Mobile Center" line
    in /Users/hojberg/code/upserve/mobile_app/ios/Podfile, inside
    the "target" section, then rerun the react-native link. Mobile Center pods will be added below the comment.

(node:51385) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

It seems really silly that things break on a missing comment lol?
Anyway.. Adding that comment I end up in this state:

? For the iOS app, should user tracking be enabled automatically? Enable Automatically
Added code to initialize iOS Crashes SDK in ios/Upserve/AppDelegate.m
Analyzing dependencies
Fetching podspec for `React` from `../node_modules/react-native`
[!] Unable to satisfy the following requirements:

- `MobileCenter (~> 0.4.0)` required by `Podfile`

None of your spec sources contain a spec satisfying the dependency: `MobileCenter (~> 0.4.0)`.

You have either:
 * out-of-date source repos which you can update with `pod repo update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.

Swift applications are not supported by react-native link

After run react-native link, I get some Error:

Added code to initialize iOS Crashes SDK in ios/DoctorApp/public/AppDelegate.m (node:95889)
UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Command failed: pod init
(node:95889) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

My project already has a podfile, so how could I fix this๏ผŸ please help me. thanks

RNMobileCenterShared (0.9.1) Download link broken

Hi when doing react-native link mobile-center I'm getting this error it seems that download link for 0.9.1 is broken.

Installing RNMobileCenterShared (0.9.1)

[!] Error installing RNMobileCenterShared
[!] /usr/bin/curl -f -L -o /var/folders/mr/mfskz4mn4hx5c9vclqqwj2280000gn/T/d20170930-14300-szr8lr/file.zip https://github.com/Microsoft/MobileCenter-SDK-React-Native/releases/download/0.9.1/MobileCenter-SDK-ReactNative-iOS-Pod-0.9.1.zip --create-dirs --netrc-optional

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   196    0   196    0     0    251      0 --:--:-- --:--:-- --:--:--   251
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
curl: (22) The requested URL returned error: 404 Not Found

Add beacon label to React Native questions

The current question just say "What is the android key" - this can get confusing when react-native link is called with multiple plugins. Have a way to show that questions are specific to a Mobile Center SDK.

Error while linking SDKs

Hi, I am getting the following error while trying to link the SDKs:

(node:41602) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: Cannot read property '0' of null.

Not sure if it's just me that's getting this error. I can manually link the SDKs for now but just wanted to report the issue so it could be fixed. May be a better error message would help.

Support detached Expo apps

Edit: This is not a mobile-center-sdk-react-native issue, but rather related to ห‹react-native linkห‹ and the way it deals with cocoa pods. see expo/expo#254 and facebook/react-native#15460

โ€”โ€”โ€”
I think this is quite relevant for react-native devs using Expo instead of CRNA as a starting point:

The problem: React/RCTBridgeDelegate.h' file not found

  • I've created a react-native project using the Expo XDE on MacOS.

  • Then I detached, which gave me an android and an iOS project.

  • Then I added the mobile-center-sdk following the official instructions.

  • Now, when I open the iOS *.workspace in XCode, I get compilation errors React/RCTBridgeDelegate.h' file not found, because the

    • RNMobileCenter
    • RNAnalytics
    • RNCrashes

    ... libraries won't find the React library.

Manual Fix:

If I manually add (RECURSIVE)

$(SRCROOT)/../../../ios/Pods/Headers/Public

to the Header Search Paths of EACH of the Libraries above, the app compiles.

This is probably due to the way expo bundles it's dependencies via cocoapods, see sample Podfile

Manually modifying the Header Search Paths is obviously not a viable solution, especially when building under CI, eg. using Mobile Center.

Suggestion

Add $(SRCROOT)/../../../ios/Pods/Headers/Public for Debug/Release in:

I think this wouldn't do any harm and make the happy little Expo users even happier ;-)

#26

Adding MobileCenter pod to Podfile is fragile

Problem

When adding the MobileCenter dependencies to the Podfile it's assumed that the file contains a line:

# Pods for โ€ฆ

If a Podfile doesn't contain this string, the script blows up with undefined property 0 on null on this line: https://github.com/Microsoft/mobile-center-sdk-react-native/blob/master/mobile-center-link-scripts/src/ios/PodFile.js#L26

Solution

I don't know what could be a more reliable way to insert it ๐Ÿ˜•

Maybe at least it would be nice to give a better error message explaining the issue, instead of throwing undefined property 0 on null?

Send push notification from mobile device

Is it possible to send push notification with mobile-center from a mobile device?
If yes, how?
If no, are there plans for implementing this feature?

Thanks, Adri

Don't hardcode path to ios project

In MobileCenterCrashes and MobileCenterAnalytics, the FRAMEWORK_SEARCH_PATHS key is hardcoded in the package's respective project files so that the react-native project's ios folder has to be called ios:
https://github.com/Microsoft/mobile-center-sdk-react-native/blob/0feed4207aabd0bf2b14dd2932bd5a68b9f56f33/mobile-center-crashes/ios/RNCrashes.xcodeproj/project.pbxproj#L236-L246

Similar packages like Reacts RCTLinking project, does not do this:
https://github.com/facebook/react-native/blob/acd9a29d94f145ae5b1c755ace7bb71964e363c6/Libraries/LinkingIOS/RCTLinking.xcodeproj/project.pbxproj#L256-L260

Would it be possible to remove the hardcoded FRAMEWORK_SEARCH_PATHS to support projects where the main folder is not called ios? Specifically, I need this because I have two ios projects that are built in parallell from the same repository with the same dependencies.

Push via API

Is there an API to push notifications programmatically? If not is there a time frame of when an endpoint might be available? Or are there any examples of how to integrate this with a third party application?

Android only link?

Apparently, it's not possible to link mobile-center to Android only project. When I try it I end up with following error.

react-native link mobile-center
Scanning 604 folders for symlinks in D:\workspace\tracker2\node_modules (65ms)
D:\workspace\tracker2\node_modules\mobile-center-link-scripts\src\ios\index.js:24
    throw Error(`
    ^

Error:
        Could not find AppDelegate.m file for this project, so could not add the framework for iOS.
        You may have to add the framework manually.

    at Object.<anonymous> (D:\workspace\tracker2\node_modules\mobile-center-link-scripts\src\ios\index.js:24:11)
    at Module._compile (module.js:573:30)
    at Object.Module._extensions..js (module.js:584:10)
    at Module.load (module.js:507:32)
    at tryModuleLoad (module.js:470:12)
    at Function.Module._load (module.js:462:3)
    at Module.require (module.js:517:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (D:\workspace\tracker2\node_modules\mobile-center-link-scripts\src\index.js:3:10)
    at Module._compile (module.js:573:30)
D:\workspace\tracker2\node_modules\react-native\local-cli\core\makeCommand.js:29
        throw new Error(`Error occured during executing "${command}" command`);
        ^

Error: Error occured during executing "node node_modules/mobile-center/scripts/prelink" command
    at ChildProcess.prelink (D:/workspace/tracker2/node_modules/react-native/local-cli/core/makeCommand.js:29:15)
    at emitTwo (events.js:125:13)
    at ChildProcess.emit (events.js:213:7)
    at maybeClose (internal/child_process.js:927:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)

Provide an api for send crashes to Mobile Center programmatic

Hi, there.

We use a little javascript to catch the runtime javascript exceptions and provide a dialog for the end user, the question here is we can capture the javascript error and give a alert for user we have a trouble with our app and the app will not crash since we handle the exception already. but we need to know whats going to here, and we want send these crashes to Mobile center so we can do more job for this kind of crashes.

The code seems like:

const noop = () => {};

export const setJSExceptionHandler = (customHandler = noop, allowedInDevMode = false) => {
  const allowed = allowedInDevMode ? true : !__DEV__;
  if (allowed) {
    global.ErrorUtils.setGlobalHandler(customHandler);
  } else {
    console.log('Skipping setJSExceptionHandler: Reason: In DEV mode and allowedInDevMode = false');
  }
};

export const getJSExceptionHandler = () => global.ErrorUtils.getGlobalHandler();

export default {
  setJSExceptionHandler,
  getJSExceptionHandler
};

and use it as:

const errorHandler = (e, isFatal) => {
  if (isFatal) {
    Alert.alert('Error`, [
      {
        text: 'OK',
       // TODO 
        onPress:()=> send crashes to mobile center here .
      },
    ])
  } else {
    console.log(e) 
  }
}

setJSExceptionHandler(errorHandler)

any thoughts ?

Thanks for the wonderful job.

Native linking fails on iOS

Hey there, I followed the install instructions on the AppCenter, react-native link command fails with:

[!] Unable to find a specification for `AppCenterReactNativeShared (~> 1.0.1)`
  • I was asked & provided the android secret
  • I was asked & provided the ios secret
  • [email protected]

Any ideas on what could be happening?
Thank you

Add README.md files to individual SDKs

When published, the individual SDKs do not have a README. I would suggest adding a README to each SDK folder so that they are present when they are published to npm.

The README could also have all the APIs that we currently show in the documentation.

Trouble with iOS and Mobile Center

Hi!
I've used Mobile Center with Analytics and Crash before. Now I'm trying to integrate Push. But I'm having some problems with iOS and XCode. It works great on Android though.

What could be the problem?

Here are som error messages:
screen shot 2017-07-05 at 10 16 41
screen shot 2017-07-05 at 10 13 53
screen shot 2017-07-05 at 10 09 34

iOS Secret never requested.

AppCenter never requests the iOS Secret, only Android. I tried running:

react-native link

and

react-native link appcenter
react-native link appcenter-analytics
react-native link appcenter-crashes

however, only the Android Secret is requested. RNPM returns:

App Secret for Android written to android/app/src/main/assets/appcenter-config.json
rnpm-install info Linking appcenter android dependency
rnpm-install info Android module appcenter has been successfully linked
rnpm-install info Linking appcenter ios dependency
rnpm-install info iOS module appcenter has been successfully linked

Error loading file

On our iOS SDK GH, @pvinis has created an issue which belongs here.

I added this sdk to a react native app, by just adding the npm packages and then in cocoapods, like the recommended way says. I call the generate crash on the native part of the application, and it crashes correctly. Then next time it opens, i get an error like [MobileCenterCrashes] ERROR: -[MSWrapperExceptionManager loadWrapperExceptionDataWithUUIDString:]/179 Error loading file /var/mobile/Containers/Data/Application/C6EEA96E-122D-4A1F-B78C-CE8C506CFD24/Documents/wrapper_exceptions/A2FCB855-6C78-499A-A55B-85F7C438CC51.ms: The file โ€œA2FCB855-6C78-499A-A55B-85F7C438CC51.msโ€ couldnโ€™t be opened because there is no such file.
What is the problem? It is a bug?

Let's look into this and see what the problem is.

Cannot read property 'trackEvent' of undefined

Dependencies installed:
"mobile-center":`` "^0.10.0", "mobile-center-analytics": "^0.10.0", "mobile-center-crashes": "^0.10.0"

Installation description i used:
https://docs.microsoft.com/en-us/mobile-center/sdk/getting-started/react-native

Implementation in Code:

import Analytics from 'mobile-center-analytics'; Analytics.trackEvent('Video clicked', { Category: 'Music', FileName: 'favorite.avi' });

Typescript compiles. App loads. Snippet above gets called before redux provider or routing.
screen shot 2017-10-30 at 09 03 50

Build for Android cannot find dependencies

A problem occurred configuring project ':mobile-center-crashes'.
> Could not resolve all dependencies for configuration ':mobile-center-crashes:_debugPublishCopy'.
> Could not find any matches for com.microsoft.azure.mobile:mobile-center-crashes:0.6.+ as no versions of com.microsoft.azure.mobile:mobile-center-crashes are available.
Required by:
QGenda:mobile-center-crashes:unspecified
> Could not find any matches for com.microsoft.azure.mobile.react:mobile-center-react-native:0.3.+ as no versions of com.microsoft.azure.mobile.react:mobile-center-react-na
tive are available.
Required by:
QGenda:mobile-center-crashes:unspecified

Runtime exception during initialization

Setup:

  • RN 0.44
  • NOT using cocoapods.

App is crashing in the call to either [[RNCrashes register]] or [[RNAnalytics registerWith....]]

stacktrace:

2017-05-23 17:19:58.816 puffboard[50892:2822372] -[MSWrapperSdk initWithWrapperSdkVersion:wrapperSdkName:liveUpdateReleaseLabel:liveUpdateDeploymentKey:liveUpdatePackageHash:]: unrecognized selector sent to instance 0x600000078ec0
2017-05-23 17:19:58.829 puffboard[50892:2822372] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MSWrapperSdk initWithWrapperSdkVersion:wrapperSdkName:liveUpdateReleaseLabel:liveUpdateDeploymentKey:liveUpdatePackageHash:]: unrecognized selector sent to instance 0x600000078ec0'
*** First throw call stack:
(
0 CoreFoundation 0x0000000109f6fb0b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010898e141 objc_exception_throw + 48
2 CoreFoundation 0x0000000109fdf134 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x0000000109ef6840 forwarding + 1024
4 CoreFoundation 0x0000000109ef63b8 _CF_forwarding_prep_0 + 120
5 puffboard 0x0000000107d8c05b +[RNMobileCenter configureMobileCenter] + 120
6 puffboard 0x0000000107bcfc15 +[RNAnalytics registerWithInitiallyEnabled:] + 53
7 puffboard 0x0000000107bcc249 -[AppDelegate application:didFinishLaunchingWithOptions:] +

Error when package.json name doesn't match iOS folder

If the package.json name doesn't equal the iOS folder, the react-link command fails.

Suggestion

From https://github.com/Microsoft/mobile-center-sdk-react-native/blob/d54ed9768e28ea11e1bdea2d52e03715d4d99c68/mobile-center-link-scripts/src/ios/MobileCenterConfig.js#L43

I suggest modifying this line:

var globString = `**/${(pjson && pjson.name ? pjson.name : '*')}.xcodeproj/project.pbxproj`

to simply:

var globString = `**/*/project.pbxproj`

Otherwise, at least include the globString in the error (because the projectsPath list is blank if not found):

Could not locate the xcode project to add MobileCenter-Config.plist file to. 
                Looked in paths - 
                ${JSON.stringify(globString)}

Header error

I get a missing header error when running on React Native 0.42.

#import <React/RCTBridgeDelegate.h>

I believe 0.41 introduced a new location for the headers - Has mobile-center-crashes not been updated for that?

RNMobileCenterShared not found

I get the following during the ios build:

/node_modules/mobile-center-analytics/ios/RNAnalytics/RNAnalytics.m:22:9: fatal error: module 'RNMobileCenterShared' not found
@import RNMobileCenterShared;
 ~~~~~~~^~~~~~~~~~~~~~~~~~~~
1 error generated.



** BUILD FAILED **

My mobile-center-analytics and mobile-center-crashes packages are both at 0.7.0.

I suspect this has something to do with my podfile dependencies, but I have had no luck searching for the solution.

My pods are declared as

  pod 'RNMobileCenter', '~> 0.4.0'
  pod 'MobileCenter', '~> 0.6.0'

Any advice to solve this issue? Thanks!

Linking pod error when building using Mobile center builds

I get the following errors when i attempt to build my application using mobile center builds just after installing mobile-center-sdk-react-native

โ–ธ Linking MYAPP
โŒ ld: library not found for -lPods-MYAPP
โŒ clang: error: linker command failed with exit code 1 (use -v to see invocation)
โ–ธ Linking MYAPP
โŒ ld: library not found for -lPods-MYAPP
โŒ clang: error: linker command failed with exit code 1 (use -v to see invocation)

Android RN app crashses after adding mobile-center-push

Hi,
I added mobile-center-push package to my RN app. Followed the steps from https://docs.microsoft.com/en-us/mobile-center/sdk/push/react-native-android.

After doing react-native run-android on my device the build process finishes without errors but as soon as the app launches it crashes.
This builds and works on the iOS project which I tested on an iPad Pro.

On my package.json I have
"mobile-center": "^0.7.0",
"mobile-center-analytics": "^0.7.0",
"mobile-center-crashes": "^0.7.0",
"mobile-center-push": "^0.7.0",
"react": "16.0.0-alpha.6",
"react-native": "0.44.3"

The device I'm testing on is a Moto Z Play (Android 7.0)
After installing a logging application I could see this error when launching:
No static method zzb

EDIT:
Was able to make it work by adding this to build.gradle

  compile "com.google.firebase:firebase-core:11.0.2"
  compile "com.google.firebase:firebase-messaging:11.0.2"

Though the documentation explicitly says not to add them...
Could something have failed with the link process? Tried it several times.

Thanks.

module 'MobileCenterCrashes' not found

During the linking process, I get this warning.

Could not determine correct xcode proj path to retrieve related plist file, there are multiple xcodeproj under the solution.

When running I get this:

/Users/tscott/code/glg/recruiting-partner-app/node_modules/mobile-center-crashes/ios/RNCrashes/RNCrashesUtils.m:3:9: fatal error: module 'MobileCenterCrashes' not found
@import MobileCenterCrashes.MSErrorReport;

The error is correct. There is no file or text "MobileCenterCrashes" in my code.

We have a custom native library in the repo. It's not under the ios folder though. It's at {project root}/components/MyCustomLibrary/ios/MyCustomLibrary.xcodeproj which is referenced in the app.

Using the Push service alongside a third-party push notification library

The scenario I am trying to implement is:

  • use APNS and FCM to send data push notifications from the server; have the mobile app decide what and how to display to the user;
  • use Mobile Center to send marketing notifications (always noisy except when the app is in the foreground).

On iOS this works great and is documented under "Disable automatic forwarding of application delegate's methods to Mobile Center services".

On Android, I cannot seem to be able to achieve the same functionality:

  • if I keep both Mobile Center Push and the third-party library, I will get duplicate push notifications when the app is not running (I assume both register to FCM separately); this is not necessarily a problem when the app is in the foreground since I can implement only one set of callbacks;
  • if I keep only Mobile Center there is no way to get the FCM device registration token, so I cannot reference the device on the server; as far as I can tell there is no way to get this information from the Mobile Center API also.

Details: React Native 0.46.4, mobile-center-* 0.8.1, react-native-push-notification 3.0.0 as the third-party library.

iOS SDK is initialized with wrapper sdk version 0.1.0

I just came across this today

+ (void) configureMobileCenter
{
  if (![MSMobileCenter isConfigured]) {
      MSWrapperSdk * wrapperSdk =
        [[MSWrapperSdk alloc]
            initWithWrapperSdkVersion:@"0.1.0"
            wrapperSdkName:@"mobilecenter.react-native"
            liveUpdateReleaseLabel:nil
            liveUpdateDeploymentKey:nil
            liveUpdatePackageHash:nil];
      [self setWrapperSdk:wrapperSdk];
      [MSMobileCenter configureWithAppSecret:[RNMobileCenter getAppSecret]];
  }
}

it should be 0.4.0, right?

crash on startup

@sopaco created an issue on iOS SDK which is a react native issue.

due to uncaught exception 'NSInvalidArgumentException', reason: '-[MSWrapperSdk initWithWrapperSdkVersion:wrapperSdkName:liveUpdateReleaseLabel:liveUpdateDeploymentKey:liveUpdatePackageHash:]: unrecognized selector sent to instance 0x618000268c00'

[RNCrashes registerWithCrashDelegate: [[RNCrashesDelegateAlwaysSend alloc] init]];  // Initialize Mobile Center crashes
  [RNAnalytics registerWithInitiallyEnabled:true];  // Initialize Mobile Center analytics

Support bitcode builds

When I try to build my application I get:

โŒ  ld: bitcode bundle could not be generated because '/Users/sharnik/Code/brains-and-beards/metro/remy-client/ios/Pods/RNMobileCenter/RNMobileCenter/RNMobileCenter.framework/RNMobileCenter(RNMobileCenter.o)' was built without full bitcode. All object files and libraries for bitcode must be generated from Xcode Archive or Install build for architecture armv7

I can workaround it by disabling bitcode in my app, but probably in the long run this step shouldn't be necessary.

Align manual installation steps to iOS SDKs

The current Mobile Center iOS SDK needs the libraries in the vendor folder, while React Native says that the libraries can be added to the top level folder.
Can this SDK be similar to the native SDK ?

carthage support

i hate hate hate cocoapods, and many other people do.
could you please add carthage support?
also some better instructions on how to add the react native sdk manually.
thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.