Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Understanding your project / AirWatch MDM integration #17

Open
DaKaZ opened this issue Jan 15, 2019 · 5 comments
Open

Understanding your project / AirWatch MDM integration #17

DaKaZ opened this issue Jan 15, 2019 · 5 comments

Comments

@DaKaZ
Copy link

DaKaZ commented Jan 15, 2019

Hello,

I recently was pointed to your project and I am just wanting to learn a little more. Unfortunately your readme file just doesn't have the details I am looking for.

I am currently implementing an integration with the AirWatch SDK to provide MDM(ish) functions for our native app. Is react-native-mdm meant to be a generic interface for any MDM library? I am thinking it might be based on the code I just looked at.

For example, in my current implementation I have two main areas of development. First, I have a new react-native native-module named AirWatchReactNative. This module basically provides a dispatchEvent function that is used to notify the app when something happens as well as the list of supported events. Its implementation looks like this:

#import "AirWatchReactNative.h"
#if __has_include(<React/RCTEventDispatcher.h>)
#import <React/RCTEventDispatcher.h>
#else
#import "RCTEventDispatcher.h"
#endif

@implementation AirWatchReactNative
@synthesize sharedInstance;

+ (BOOL)requiresMainQueueSetup
{
  return NO;
}

- (instancetype)init
{
  self = [super init];
  self.sharedInstance = self;
  return self;
}

- (dispatch_queue_t)methodQueue
{
  return dispatch_get_main_queue();
}

- (void)dispatchEvent:(NSString *)name withBody: (NSDictionary *)body {
  NSLog(@"Calling dispatch: %@", name);
  [self sendEventWithName:name body:body];
}

- (NSArray<NSString *> *)supportedEvents
{
  return @[
           @"AWreceivedProfiles",
           @"AWenrollmentStatus",
           @"AWinitialCheck",
           @"AWwipe",
           @"AWlock",
           @"AWunlock",
           @"AWstopNetwork",
           @"AWresumeNetwork"
           ];
}

RCT_EXPORT_MODULE();

@end

I think call these methods when the AirWatch SDK functions are called. In my AppDelegate.swift file (yes, we had to use swift because AirWatch SDK is only available in swift now) we do this (just one example):

  func controllerDidReceive(profiles: [Profile]) {
    AWLogVerbose("SDK recieved \(profiles.count) profiles.")
    
    guard profiles.count > 0 else {
      AWLogError("No profile received")
      AirWatchReactNative().sharedInstance.dispatchEvent("AWreceivedProfiles", withBody: [
        "count": profiles.count,
        "profiles": []
        ]
      )
      return
    }
    AWLogInfo("Now printing profiles received: \n")
    profiles.forEach { AWLogInfo("\(String(describing: $0))") }
    AirWatchReactNative().sharedInstance.dispatchEvent("AWreceivedProfiles", withBody: [
      "count": profiles.count,
      "profiles": profiles
      ]
    )
  }

What I am wondering is if react-native-mdm is meant to replace my AirWatchReactNative module and if so, what your roadmap for features looks like as there are numerous events beyond app_config that need to be supported. If this is your intended purpose, I'd gladly lend effort to extend react-native-mdm to support our needs, but if it is not, I just need to know so that I don't waste the effort.

@DaKaZ DaKaZ changed the title Understanding your project Understanding your project / AirWatch MDM integration Jan 15, 2019
@pavinthan
Copy link

@DaKaZ could you please share your AirWatch integration because we need same feature ?

@dennylesmanajr
Copy link

Hi , is react-native-mdm just for Airwatch or supported other providers ? is there any list of supported MDM providers ?

Thanks

@jeveloper
Copy link

@DaKaZ Hey there, could you share if you had success with Airwatch or didnt and some feedback?
trying to evaluate it . Thanks

@shouse
Copy link

shouse commented Apr 8, 2020

We did have success with the integration. I'm worked with Kaz. We can't share the code unfortunately because of restrictions from our client.

@kappe
Copy link

kappe commented Oct 1, 2020

Short question: I've integrated AWS-SDK into my React Native App. Now I've one small problem. When the Task Switch is activated a BlockerView should be shown. AWS logs that the View is shown but it is not?
2020-10-01 10:59:02.579528+0200 zeusMobile[475:24568] 2020-10-01 10:59:02:576 zeusMobile[475:24182] +[AWSDKPresentation showBlockerView] [Line:410][I]: Showing blocker view.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants