Skip to content

Commit

Permalink
g功能优化
Browse files Browse the repository at this point in the history
  • Loading branch information
fengchuanxiang committed Aug 19, 2017
1 parent 783aab0 commit cca06b5
Show file tree
Hide file tree
Showing 142 changed files with 2,216 additions and 198 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 18 additions & 6 deletions FCXUniversial/FCXUniversial/FCXRating.m → FCXRating.m
Original file line number Diff line number Diff line change
Expand Up @@ -260,12 +260,24 @@ + (void)goRating:(NSString *)appID {
return;
}

NSString *strUrl =[NSString stringWithFormat: @"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%@", appID];
if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:strUrl]]) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:strUrl]];
}else{
strUrl =[NSString stringWithFormat: @"https://itunes.apple.com/app/id%@", appID];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:strUrl]];
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat: @"itms-apps://itunes.apple.com/app/id%@?action=write-review", appID]];

UIApplication *application = [UIApplication sharedApplication];
if ([application canOpenURL:url]) {
[application openURL:url];
return;
}

url = [NSURL URLWithString:[NSString stringWithFormat: @"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%@", appID]];
if ([application canOpenURL:url]) {
[application openURL:url];
return;
}

url = [NSURL URLWithString:[NSString stringWithFormat: @"https://itunes.apple.com/app/id%@", appID]];
if ([application canOpenURL:url]) {
[application openURL:url];
return;
}
}

Expand Down
13 changes: 8 additions & 5 deletions FCXUniversial.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ Pod::Spec.new do |s|
s.source = { :git => "https://github.com/FCXPods/FCXUniversial.git", :tag => "0.0.1" }
s.platform = :ios, "6.0"

s.source_files = "FCXUniversial/FCXAbout/", "FCXUniversial/FCXDiscover/", "FCXUniversial/FCXCategory/", "FCXUniversial/FCXUniversial/", "FCXUniversial/FCXUniversial/UIKit/", "FCXUniversial/FCXUniversial/Foundation/", "FCXUniversial/FCXAdvert/", "FCXUniversial/FCXAdvert/Baidu/", "FCXUniversial/FCXShare/", "UMSocial/UMSocial_Sdk_5.0.1/Header/*.h", "UMSocial/UMSocial_Sdk_Extra_Frameworks/Wechat/*.h", "UMSocial/UMSocial_Sdk_Extra_Frameworks/TencentOpenAPI/*.h", "UMSocial/UMSocial_Sdk_Extra_Frameworks/SinaSSO/*.h", "FCXUniversial/FCXAdvert/Mediation Adapters/*.h"
s.source_files = "FCXUniversial/FCXAbout/", "FCXUniversial/FCXDiscover/", "FCXUniversial/FCXCategory/", "FCXUniversial/FCXUniversial/", "FCXUniversial/FCXUniversial/UIKit/", "FCXUniversial/FCXUniversial/Foundation/", "FCXUniversial/FCXAdvert/", "FCXUniversial/FCXAdvert/Baidu/", "FCXUniversial/FCXShare/", "FCXUniversial/FCXAdvert/Mediation Adapters/*.h", "MTA/*.h"

s.resources = "FCXUniversial/FCXShare/ShareIcon/*.png", "UMSocial/**/*.{bundle,xib,.lproj}"
s.resources = "FCXUniversial/FCXShare/ShareIcon/*.png"

s.vendored_libraries = "FCXUniversial/FCXAdvert/libGDTMobSDK.a", "UMSocial/**/*.a"
s.vendored_frameworks = "FCXUniversial/FCXAdvert/GoogleMobileAds.framework", "FCXUniversial/FCXAdvert/Baidu/BaiduMobAdSDK.framework", "UMSocial/**/*.framework", "UMSocial/UMSocial_Sdk_Extra_Frameworks/TencentOpenAPI/TencentOpenAPI.framework"
s.vendored_libraries = "FCXUniversial/FCXAdvert/libGDTMobSDK.a", "MTA/*.a"
s.vendored_frameworks = "FCXUniversial/FCXAdvert/GoogleMobileAds.framework", "FCXUniversial/FCXAdvert/Baidu/BaiduMobAdSDK.framework"

s.frameworks = "AdSupport", "CoreLocation", "SystemConfiguration", "CoreTelephony", "Security", "StoreKit", "QuartzCore", "AudioToolbox", "AVFoundation", "CoreGraphics", "CoreMedia", "EventKit", "EventKitUI", "MessageUI", "CoreMotion", "MediaPlayer", "MessageUI", "CoreLocation", "Foundation", "WebKit"

Expand All @@ -31,8 +31,11 @@ s.libraries = "z", "iconv", "sqlite3", "stdc++", "c++"

s.dependency "SDWebImage", "~> 3.7.5"
s.dependency "UMengAnalytics", "~> 4.2.4"
#s.dependency "UMengSocial", "~> 5.0"
# s.dependency "UMOnlineConfig", "~> 0.1.0"
s.dependency "UMengFeedback", "~> 2.3.4"
s.dependency "UMengUShare/Social/Sina", "~> 6.4.5"
s.dependency "UMengUShare/Social/WeChat", "~> 6.4.5"
s.dependency "UMengUShare/Social/QQ", "~> 6.4.5"
s.dependency "UMengUShare/Social/SMS", "~> 6.4.5"

end
27 changes: 18 additions & 9 deletions FCXUniversial/FCXAbout/FCXAboutController.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,30 @@ - (void)viewDidLoad {

CGFloat width = SCREEN_WIDTH == 320 ? 110 : 130;

UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake((SCREEN_WIDTH - width)/2.0, top, width, width)];
imageView.image = [UIImage imageNamed:self.imageName];
imageView.layer.cornerRadius = 5;

UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake((self.view.frame.size.width - 106)/2.0, 132, 106, 149)];
imageView.image = [UIImage imageNamed:@"login_icon"];
[self.view addSubview:imageView];

// UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake((SCREEN_WIDTH - width)/2.0, top, width, width)];
// imageView.image = [UIImage imageNamed:self.imageName];
// imageView.layer.cornerRadius = 5;
// [self.view addSubview:imageView];

NSString *str = [NSString stringWithFormat:@"%@\n%@", self.appName, self.midString];
NSMutableAttributedString *attributedStr = [[NSMutableAttributedString alloc] initWithString:str];

[attributedStr addAttribute:NSFontAttributeName
value:[UIFont fontWithName:@"Helvetica-Bold" size:28]
range:NSMakeRange(0, self.appName.length)];
str = self.midString;

NSMutableAttributedString *attributedStr = [[NSMutableAttributedString alloc] initWithString:str];
[attributedStr addAttribute:NSFontAttributeName
value:[UIFont fontWithName:@"HelveticaNeue-Light" size:16]
range:NSMakeRange(self.appName.length, str.length - self.appName.length)];
range:NSMakeRange(0, str.length)];
// [attributedStr addAttribute:NSFontAttributeName
// value:[UIFont fontWithName:@"Helvetica-Bold" size:28]
// range:NSMakeRange(0, self.appName.length)];

// [attributedStr addAttribute:NSFontAttributeName
// value:[UIFont fontWithName:@"HelveticaNeue-Light" size:16]
// range:NSMakeRange(self.appName.length, str.length - self.appName.length)];

NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
paragraphStyle.lineSpacing = 10;
Expand Down
2 changes: 1 addition & 1 deletion FCXUniversial/FCXAdvert/GDTCustomView.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
@param appkey 应用id
@param placementId 广告位id
@param controller 开发者需传入用来弹出目标页的ViewController,一般为当前ViewController
@param controller 显示广告的标题
@param adName 显示广告的标题
@return GDTCustomView
*/
- (instancetype)initWithFrame:(CGRect)frame
Expand Down
28 changes: 18 additions & 10 deletions FCXUniversial/FCXAdvert/GDTCustomView.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
#import "UMMobClick/MobClick.h"
#import "FCXDefine.h"
#import "UIView+Frame.h"
#import "SKA.h"

@interface GDTCustomView () <GDTNativeAdDelegate>
{
GDTNativeAd *_nativeAd;
NSString *_adName;
UILabel *_titleLabel;
UIImageView *_imageView;
UIImageView *_logoImageView;
}

@property (nonatomic, strong) GDTNativeAdData *adData;
Expand Down Expand Up @@ -65,6 +67,7 @@ - (void)startTimer {
} else {
[_timer setFireDate:[NSDate dateWithTimeIntervalSinceNow:30]];
}
[self refreshData];
}

- (void)stopTimer {
Expand All @@ -81,13 +84,13 @@ - (void)adClickAction {
[_nativeAd clickAd:self.adData];

if (self.eventId) {
[MobClick event:self.eventId label:@"点击广点通广告"];
[SKA event:self.eventId label:@"点击广点通广告"];
}
}
}

- (void)setup:(NSString *)title imgURL:(NSString *)imgURL {
CGFloat space = 15;
CGFloat space = 16;

if (!_titleLabel) {
//推广
Expand All @@ -105,7 +108,8 @@ - (void)setup:(NSString *)title imgURL:(NSString *)imgURL {

//标题
_titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(label.right + 5, space, self.width - label.right - space * 2 - 12, 16)];
_titleLabel.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:16];
_titleLabel.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:15];
_titleLabel.textColor = UICOLOR_FROMRGB(0x343233);
[self addSubview:_titleLabel];

UIImageView *arrowImageView = [[UIImageView alloc] initWithFrame:CGRectMake(self.width - 12 - space, _titleLabel.top, 12, 16)];
Expand All @@ -117,18 +121,27 @@ - (void)setup:(NSString *)title imgURL:(NSString *)imgURL {
_imageView.clipsToBounds = YES;
_imageView.contentMode = UIViewContentModeScaleAspectFill;
[self addSubview:_imageView];

_logoImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 15, 15)];
_logoImageView.image = [UIImage imageNamed:@"gdt_logo"];
[_imageView addSubview:_logoImageView];
}

_titleLabel.text = title;

__weak typeof(self) weakSelf = self;
CGFloat top = _titleLabel.bottom + 5;

__weak UIImageView *weakImageView = _imageView;
__weak UIImageView *weakLogoImageView = _logoImageView;
[_imageView sd_setImageWithURL:[NSURL URLWithString:imgURL] completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {

if (error && !image) {
return ;
}
CGFloat height = image.size.height * ((weakSelf.frame.size.width - space * 2)/image.size.width);

_imageView.frame = CGRectMake(space, top, weakSelf.frame.size.width - space * 2, height);
weakImageView.frame = CGRectMake(space, top, weakSelf.frame.size.width - space * 2, height);
weakLogoImageView.frame = CGRectMake(5, weakImageView.frame.size.height - weakLogoImageView.frame.size.height - 5, _logoImageView.frame.size.width, weakLogoImageView.frame.size.height);

weakSelf.height = top + height + space;
if (weakSelf.loadFinishBlock) {
Expand Down Expand Up @@ -167,17 +180,14 @@ -(void)nativeAdFailToLoad:(NSError *)error {
- (void)nativeAdWillPresentScreen;
{
NSLog(@"%s", __func__);

}

/**
* 原生广告点击之后应用进入后台时回调
*/
- (void)nativeAdApplicationWillEnterBackground;
{

NSLog(@"%s", __func__);

}

/**
Expand All @@ -186,8 +196,6 @@ - (void)nativeAdApplicationWillEnterBackground;
- (void)nativeAdClosed;
{
NSLog(@"%s", __func__);

}


@end
95 changes: 95 additions & 0 deletions FCXUniversial/FCXAdvert/GDTNativeExpressAd.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
//
// GDTNativeExpressAd.h
// GDTMobApp
//
// Created by michaelxing on 2017/4/17.
// Copyright © 2017年 Tencent. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@class GDTNativeExpressAdView;
@class GDTNativeExpressAd;

@protocol GDTNativeExpressAdDelegete <NSObject>

@optional
/**
* 拉取原生模板广告成功
*/
- (void)nativeExpressAdSuccessToLoad:(GDTNativeExpressAd *)nativeExpressAd views:(NSArray<__kindof GDTNativeExpressAdView *> *)views;

/**
* 拉取原生模板广告失败
*/
- (void)nativeExpressAdFailToLoad:(GDTNativeExpressAd *)nativeExpressAd error:(NSError *)error;

/**
* 原生模板广告渲染成功
*/
- (void) nativeExpressAdViewRenderSuccess:(GDTNativeExpressAdView *)nativeExpressAdView;

/**
* 原生模板广告渲染失败
*/
- (void) nativeExpressAdViewRenderFail:(GDTNativeExpressAdView *)nativeExpressAdView;

/**
* 原生模板广告曝光回调
*/
- (void)nativeExpressAdViewExposure:(GDTNativeExpressAdView *)nativeExpressAdView;

/**
* 原生模板广告点击回调
*/
- (void)nativeExpressAdViewClicked:(GDTNativeExpressAdView *)nativeExpressAdView;

/**
* 原生模板广告被关闭
*/
- (void)nativeExpressAdViewClosed:(GDTNativeExpressAdView *)nativeExpressAdView;

/**
* 点击原生模板广告以后即将弹出全屏广告页
*/
- (void)nativeExpressAdViewWillPresentScreen:(GDTNativeExpressAdView *)nativeExpressAdView;

/**
* 点击原生模板广告以后弹出全屏广告页
*/
- (void)nativeExpressAdViewDidPresentScreen:(GDTNativeExpressAdView *)nativeExpressAdView;

/**
* 全屏广告页将要关闭
*/
- (void)nativeExpressAdViewWillDissmissScreen:(GDTNativeExpressAdView *)nativeExpressAdView;

/**
* 全屏广告页关闭
*/
- (void)nativeExpressAdViewDidDissmissScreen:(GDTNativeExpressAdView *)nativeExpressAdView;

/**
* 原生模板广告点击之后应用进入后台时回调
*/
- (void)nativeExpressAdViewApplicationWillEnterBackground:(GDTNativeExpressAdView *)nativeExpressAdView;

@end

@interface GDTNativeExpressAd : NSObject

/**
* 委托对象
*/
@property (nonatomic, weak) id<GDTNativeExpressAdDelegete> delegate;

/**
* 构造方法
* 详解:appkey是应用id, placementId是广告位id, adSize是广告展示的宽高(具体参看联盟广告位配置)
*/
-(instancetype)initWithAppkey:(NSString *)appkey placementId:(NSString *)placementId adSize:(CGSize)size;

- (void)loadAd:(int)count;

@end
32 changes: 32 additions & 0 deletions FCXUniversial/FCXAdvert/GDTNativeExpressAdView.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// GDTNativeExpressAdView.h
// GDTMobApp
//
// Created by michaelxing on 2017/4/14.
// Copyright © 2017年 Tencent. All rights reserved.
//

#import <UIKit/UIKit.h>


@interface GDTNativeExpressAdView : UIView

/**
* 是否渲染完毕
*/
@property (nonatomic, assign) BOOL isReady;

/*
* viewControllerForPresentingModalView
* 详解:[必选]开发者需传入用来弹出目标页的ViewController,一般为当前ViewController
*/
@property (nonatomic, weak) UIViewController *controller;


/**
*[必选]
*原生模板广告渲染
*/
- (void)render;

@end
Empty file.
Binary file modified FCXUniversial/FCXAdvert/GoogleMobileAds.framework/Versions/A/GoogleMobileAds
100755 → 100644
Binary file not shown.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ GAD_ASSUME_NONNULL_BEGIN
/// Called when adLoader fails to load an ad.
- (void)adLoader:(GADAdLoader *)adLoader didFailToReceiveAdWithError:(GADRequestError *)error;

@optional

/// Called after adLoader has finished loading.
- (void)adLoaderDidFinishLoading:(GADAdLoader *)adLoader;

@end

GAD_ASSUME_NONNULL_END
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ GAD_ASSUME_NONNULL_BEGIN
typedef void (^GADNativeAdCustomClickHandler)(NSString *assetID);

/// Asset key for the GADMediaView asset view.
static NSString *const GADNativeCustomTemplateAdMediaViewKey = @"_videoMediaView";
extern NSString *const GADNativeCustomTemplateAdMediaViewKey;

/// Native custom template ad. To request this ad type, you need to pass
/// kGADAdLoaderAdTypeNativeCustomTemplate (see GADAdLoaderAdTypes.h) to the |adTypes| parameter in
Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
12 changes: 10 additions & 2 deletions FCXUniversial/FCXAdvert/UIViewController+Advert.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,19 @@

@property (nonatomic, strong) GDTRequestManager *gdtRequestManager;
@property (nonatomic, strong) GADBannerView *mobbannerView;
@property (nonatomic, copy) dispatch_block_t success;

- (void)showAdmobBanner:(CGRect)frame adUnitID:(NSString *)adUnitID;
- (void)showAdmobBanner:(CGRect)frame
adUnitID:(NSString *)adUnitID;

- (void)showAdmobBanner:(CGRect)frame
adUnitID:(NSString *)adUnitID
superView:(UIView *)superView;
success:(dispatch_block_t)success;

- (void)showAdmobBanner:(CGRect)frame
adUnitID:(NSString *)adUnitID
superView:(UIView *)superView
success:(dispatch_block_t)success;


@end
Loading

0 comments on commit cca06b5

Please sign in to comment.