This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set the date range - this is always required for report requests | |
date_range = Google::Apis::AnalyticsreportingV4::DateRange.new( | |
start_date: `2017-01-01`, | |
end_date: `2018-01-01` | |
) | |
# Set the metric | |
metric = Google::Apis::AnalyticsreportingV4::Metric.new( | |
expression: "ga:users" | |
) | |
# Set the dimension |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a Google Analytics Reporting service | |
service = Google::Apis::AnalyticsreportingV4::AnalyticsReportingService.new | |
# Create service account credentials | |
credentials = Google::Auth::ServiceAccountCredentials.make_creds( | |
json_key_io: File.open('path/to/service_account_cred.json'), | |
scope: 'https://www.googleapis.com/auth/analytics.readonly' | |
) | |
# Authorize with our readonly credentials |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NativeModules } from 'react-native'; | |
const Greeter = NativeModules.Greeter; | |
Greeter.greet('Abigail'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "RCTGreeter.h" | |
#import <React/RCTLog.h> | |
@implementation RCTGreeter | |
RCT_EXPORT_MODULE(Greeter); | |
RCT_EXPORT_METHOD(greet:(NSString *)name) { | |
RCTLogInfo(@"Welcome, %@", name); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
#import <React/RCTBridgeModule.h> | |
@interface RCTGreeter : NSObject <RCTBridgeModule> | |
@end |